diff options
287 files changed, 899 insertions, 36565 deletions
@@ -13,6 +13,37 @@ // See the License for the specific language governing permissions and // limitations under the License. +package { + default_applicable_licenses: ["device_linaro_hikey_license"], +} + +// Added automatically by a large-scale-change that took the approach of +// 'apply every license found to every target'. While this makes sure we respect +// every license restriction, it may not be entirely correct. +// +// e.g. GPL in an MIT project might only apply to the contrib/ directory. +// +// Please consider splitting the single license below into multiple licenses, +// taking care not to lose any license_kind information, and overriding the +// default license using the 'licenses: [...]' property on targets as needed. +// +// For unused files, consider creating a 'fileGroup' with "//visibility:private" +// to attach the license to, and including a comment whether the files may be +// used in the current project. +// See: http://go/android-license-faq +license { + name: "device_linaro_hikey_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + "SPDX-license-identifier-BSD", + "SPDX-license-identifier-GPL-2.0", + "SPDX-license-identifier-MIT", + "legacy_unencumbered", + ], + // large-scale-change unable to identify any license_text files +} + subdirs = [ "bluetooth", "recovery", @@ -24,6 +24,29 @@ ifneq ($(filter hikey%, $(TARGET_DEVICE)),) LOCAL_PATH := $(call my-dir) + +ifeq (,$(wildcard $(LINARO_VENDOR_PATH)/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk)) +droidcore: $(PRODUCT_OUT)/missing_vendor_package +$(PRODUCT_OUT)/missing_vendor_package: + echo + echo "Missing Linaro Vendor Package!" + echo "Please download new binaries here:" + echo " $(VND_PKG_URL)" + echo "And extract in the ANDROID_TOP_DIR" + echo + false +endif + +$(eval $(call declare-1p-copy-files,device/linaro/hikey,.conf)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,.img)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,.kl)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,.rc)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,.xml)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,fstab.hikey)) +$(eval $(call declare-1p-copy-files,device/linaro/hikey,fstab.hikey960)) + +$(eval $(call declare-copy-files-license-metadata,device/linaro/hikey/bt-wifi-firmware-util,,SPDX-license-identifier-BSD,notice,device/linaro/hikey/bt-wifi-firmware-util/NOTICE,)) + # if some modules are built directly from this directory (not subdirectories), # their rules should be written here. diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 12f9dac5..a5ab322a 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -38,8 +38,6 @@ TARGET_USE_PAN_DISPLAY := true TARGET_USES_HWC2 := true -TARGET_AUX_OS_VARIANT_LIST := none - BOARD_SEPOLICY_DIRS += device/linaro/hikey/sepolicy BOARD_SEPOLICY_DIRS += system/bt/vendor_libs/linux/sepolicy diff --git a/METADATA b/METADATA new file mode 100644 index 00000000..6d8601bb --- /dev/null +++ b/METADATA @@ -0,0 +1,3 @@ +third_party { + license_type: RESTRICTED +} diff --git a/audio/Android.mk b/audio/Android.mk index 0a02789e..84e2e56e 100644 --- a/audio/Android.mk +++ b/audio/Android.mk @@ -24,6 +24,8 @@ include $(CLEAR_VARS) LOCAL_HEADER_LIBRARIES += libhardware_headers LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM) +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_VENDOR_MODULE := true @@ -36,16 +38,4 @@ LOCAL_C_INCLUDES += \ system/media/audio_utils/include \ system/media/audio_effects/include -ifeq ($(TARGET_ENABLE_DSP_DEVICE), true) -LOCAL_CFLAGS += -DENABLE_XAF_DSP_DEVICE -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH)/../hifi/xaf/host-apf/include \ - $(LOCAL_PATH)/../hifi/xaf/host-apf/include/os/android \ - $(LOCAL_PATH)/../hifi/xaf/host-apf/include/sys/fio\ - $(LOCAL_PATH)/../hifi/xaf/host-apf/include/audio \ - $(LOCAL_PATH)/../hifi/xaf/host-apf/utest/include - -LOCAL_STATIC_LIBRARIES := libxtensa_proxy -endif include $(BUILD_SHARED_LIBRARY) - diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 56b3e141..3fdf3f97 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -42,7 +42,6 @@ #include <audio_effects/effect_aec.h> #include <sys/ioctl.h> -#include <linux/audio_hifi.h> #define CARD_OUT 0 #define PORT_CODEC 0 @@ -362,12 +361,16 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) struct alsa_audio_device *adev = out->dev; struct str_parms *parms; char value[32]; - int ret, val = 0; + int val = 0; + int ret = -EINVAL; + + if (kvpairs == NULL || kvpairs[0] == 0) { + return 0; + } parms = str_parms_create_str(kvpairs); - ret = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); - if (ret >= 0) { + if (str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)) >= 0) { val = atoi(value); pthread_mutex_lock(&adev->lock); pthread_mutex_lock(&out->lock); @@ -377,6 +380,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } pthread_mutex_unlock(&out->lock); pthread_mutex_unlock(&adev->lock); + ret = 0; } str_parms_destroy(parms); diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml index 114db1a8..720dc059 100644 --- a/audio/audio_policy_configuration.xml +++ b/audio/audio_policy_configuration.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude"> +<audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <globalConfiguration speaker_drc_enabled="false"/> @@ -33,7 +33,7 @@ </mixPort> <mixPort name="primary input" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" - samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" + samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/> </mixPort> </mixPorts> @@ -84,7 +84,7 @@ </module> <!-- A2dp Input Audio HAL --> - <xi:include href="a2dp_in_audio_policy_configuration.xml"/> + <xi:include href="a2dp_in_audio_policy_configuration_7_0.xml"/> <!-- Usb Audio HAL --> <xi:include href="usb_audio_policy_configuration.xml"/> @@ -93,7 +93,7 @@ <xi:include href="r_submix_audio_policy_configuration.xml"/> <!-- Bluetooth Audio HAL --> - <xi:include href="bluetooth_audio_policy_configuration.xml"/> + <xi:include href="bluetooth_audio_policy_configuration_7_0.xml"/> </modules> <!-- End of Modules section --> diff --git a/bluetooth/Android.bp b/bluetooth/Android.bp deleted file mode 100644 index e421c530..00000000 --- a/bluetooth/Android.bp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2017 The Android Open Source Project -// -// 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. - -cc_binary { - name: "android.hardware.bluetooth@1.0-service.hikey", - proprietary: true, - relative_install_path: "hw", - srcs: [ - "async_fd_watcher.cc", - "bluetooth_hci.cc", - "h4_protocol.cc", - "hci_packetizer.cc", - "hci_protocol.cc", - "service.cc", - ], - cflags: [ - "-Wall", - "-Werror", - "-Wno-error=unused-const-variable", - "-Wno-error=unused-function", - "-Wno-error=unused-lambda-capture", - ], - shared_libs: [ - "android.hardware.bluetooth@1.0", - "libbase", - "libcutils", - "libhardware", - "libhidlbase", - "liblog", - "libutils", - ], - init_rc: ["android.hardware.bluetooth@1.0-service.hikey.rc"], -} diff --git a/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc b/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc deleted file mode 100644 index 6f31efdf..00000000 --- a/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc +++ /dev/null @@ -1,4 +0,0 @@ -service bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service.hikey - class hal - user bluetooth - group bluetooth diff --git a/bluetooth/async_fd_watcher.cc b/bluetooth/async_fd_watcher.cc deleted file mode 100644 index c4470d06..00000000 --- a/bluetooth/async_fd_watcher.cc +++ /dev/null @@ -1,181 +0,0 @@ -// -// Copyright 2016 The Android Open Source Project -// -// 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 "async_fd_watcher.h" - -#include <algorithm> -#include <atomic> -#include <condition_variable> -#include <map> -#include <mutex> -#include <thread> -#include <vector> -#include "fcntl.h" -#include "sys/select.h" -#include "unistd.h" - -static const int INVALID_FD = -1; - -namespace android { -namespace hardware { -namespace bluetooth { -namespace async { - -int AsyncFdWatcher::WatchFdForNonBlockingReads( - int file_descriptor, const ReadCallback& on_read_fd_ready_callback) { - // Add file descriptor and callback - { - std::unique_lock<std::mutex> guard(internal_mutex_); - watched_fds_[file_descriptor] = on_read_fd_ready_callback; - } - - // Start the thread if not started yet - return tryStartThread(); -} - -int AsyncFdWatcher::ConfigureTimeout( - const std::chrono::milliseconds timeout, - const TimeoutCallback& on_timeout_callback) { - // Add timeout and callback - { - std::unique_lock<std::mutex> guard(timeout_mutex_); - timeout_cb_ = on_timeout_callback; - timeout_ms_ = timeout; - } - - notifyThread(); - return 0; -} - -void AsyncFdWatcher::StopWatchingFileDescriptors() { stopThread(); } - -AsyncFdWatcher::~AsyncFdWatcher() {} - -// Make sure to call this with at least one file descriptor ready to be -// watched upon or the thread routine will return immediately -int AsyncFdWatcher::tryStartThread() { - if (std::atomic_exchange(&running_, true)) return 0; - - // Set up the communication channel - int pipe_fds[2]; - if (pipe2(pipe_fds, O_NONBLOCK)) return -1; - - notification_listen_fd_ = pipe_fds[0]; - notification_write_fd_ = pipe_fds[1]; - - thread_ = std::thread([this]() { ThreadRoutine(); }); - if (!thread_.joinable()) return -1; - - return 0; -} - -int AsyncFdWatcher::stopThread() { - if (!std::atomic_exchange(&running_, false)) return 0; - - notifyThread(); - if (std::this_thread::get_id() != thread_.get_id()) { - thread_.join(); - } - - { - std::unique_lock<std::mutex> guard(internal_mutex_); - watched_fds_.clear(); - } - - { - std::unique_lock<std::mutex> guard(timeout_mutex_); - timeout_cb_ = nullptr; - } - - return 0; -} - -int AsyncFdWatcher::notifyThread() { - uint8_t buffer[] = {0}; - if (TEMP_FAILURE_RETRY(write(notification_write_fd_, &buffer, 1)) < 0) { - return -1; - } - return 0; -} - -void AsyncFdWatcher::ThreadRoutine() { - while (running_) { - fd_set read_fds; - FD_ZERO(&read_fds); - FD_SET(notification_listen_fd_, &read_fds); - int max_read_fd = INVALID_FD; - for (auto& it : watched_fds_) { - FD_SET(it.first, &read_fds); - max_read_fd = std::max(max_read_fd, it.first); - } - - struct timeval timeout; - struct timeval* timeout_ptr = NULL; - if (timeout_ms_ > std::chrono::milliseconds(0)) { - timeout.tv_sec = timeout_ms_.count() / 1000; - timeout.tv_usec = (timeout_ms_.count() % 1000) * 1000; - timeout_ptr = &timeout; - } - - // Wait until there is data available to read on some FD. - int nfds = std::max(notification_listen_fd_, max_read_fd); - int retval = select(nfds + 1, &read_fds, NULL, NULL, timeout_ptr); - - // There was some error. - if (retval < 0) continue; - - // Timeout. - if (retval == 0) { - // Allow the timeout callback to modify the timeout. - TimeoutCallback saved_cb; - { - std::unique_lock<std::mutex> guard(timeout_mutex_); - if (timeout_ms_ > std::chrono::milliseconds(0)) saved_cb = timeout_cb_; - } - if (saved_cb != nullptr) saved_cb(); - continue; - } - - // Read data from the notification FD. - if (FD_ISSET(notification_listen_fd_, &read_fds)) { - char buffer[] = {0}; - TEMP_FAILURE_RETRY(read(notification_listen_fd_, buffer, 1)); - continue; - } - - // Invoke the data ready callbacks if appropriate. - std::vector<decltype(watched_fds_)::value_type> saved_callbacks; - { - std::unique_lock<std::mutex> guard(internal_mutex_); - for (auto& it : watched_fds_) { - if (FD_ISSET(it.first, &read_fds)) { - saved_callbacks.push_back(it); - } - } - } - - for (auto& it : saved_callbacks) { - if (it.second) { - it.second(it.first); - } - } - } -} - -} // namespace async -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/async_fd_watcher.h b/bluetooth/async_fd_watcher.h deleted file mode 100644 index b51f9211..00000000 --- a/bluetooth/async_fd_watcher.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright 2016 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <map> -#include <mutex> -#include <thread> - -namespace android { -namespace hardware { -namespace bluetooth { -namespace async { - -using ReadCallback = std::function<void(int)>; -using TimeoutCallback = std::function<void(void)>; - -class AsyncFdWatcher { - public: - AsyncFdWatcher() = default; - ~AsyncFdWatcher(); - - int WatchFdForNonBlockingReads(int file_descriptor, - const ReadCallback& on_read_fd_ready_callback); - int ConfigureTimeout(const std::chrono::milliseconds timeout, - const TimeoutCallback& on_timeout_callback); - void StopWatchingFileDescriptors(); - - private: - AsyncFdWatcher(const AsyncFdWatcher&) = delete; - AsyncFdWatcher& operator=(const AsyncFdWatcher&) = delete; - - int tryStartThread(); - int stopThread(); - int notifyThread(); - void ThreadRoutine(); - - std::atomic_bool running_{false}; - std::thread thread_; - std::mutex internal_mutex_; - std::mutex timeout_mutex_; - - std::map<int, ReadCallback> watched_fds_; - int notification_listen_fd_; - int notification_write_fd_; - TimeoutCallback timeout_cb_; - std::chrono::milliseconds timeout_ms_; -}; - -} // namespace async -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/bluetooth_hci.cc b/bluetooth/bluetooth_hci.cc deleted file mode 100644 index fe2b782b..00000000 --- a/bluetooth/bluetooth_hci.cc +++ /dev/null @@ -1,124 +0,0 @@ -// -// Copyright 2016 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#define LOG_TAG "android.hardware.bluetooth@1.0.hikey" - -#include "bluetooth_hci.h" - -#include <android-base/logging.h> -#include <sys/ioctl.h> -#include <sys/socket.h> -#include <unistd.h> -#include <utils/Log.h> - -namespace android { -namespace hardware { -namespace bluetooth { -namespace V1_0 { -namespace hikey { - -using android::hardware::hidl_vec; - -BluetoothHci::BluetoothHci() - : deathRecipient(new BluetoothDeathRecipient(this)) {} - -Return<void> BluetoothHci::initialize( - const ::android::sp<IBluetoothHciCallbacks>& cb) { - ALOGI("BluetoothHci::initialize()"); - - hci_tty_fd_ = open("/dev/hci_tty", O_RDWR); - if (hci_tty_fd_ < 0) { - ALOGE("%s: Can't open hci_tty (%s)", __func__, strerror(errno)); - cb->initializationComplete(Status::INITIALIZATION_ERROR); - return Void(); - } - - event_cb_ = cb; - event_cb_->linkToDeath(deathRecipient, 0); - - hci_ = new hci::H4Protocol( - hci_tty_fd_, - [cb](const hidl_vec<uint8_t>& packet) { cb->hciEventReceived(packet); }, - [cb](const hidl_vec<uint8_t>& packet) { cb->aclDataReceived(packet); }, - [cb](const hidl_vec<uint8_t>& packet) { cb->scoDataReceived(packet); }); - - // Use a socket pair to enforce the TI FIONREAD requirement. - int sockfd[2]; - socketpair(AF_LOCAL, SOCK_STREAM, 0, sockfd); - int shim_fd = sockfd[0]; - int for_hci = sockfd[1]; - - fd_watcher_.WatchFdForNonBlockingReads(hci_tty_fd_, [this, shim_fd](int fd) { - int tty_bytes = 0; - if (TEMP_FAILURE_RETRY(ioctl(fd, FIONREAD, &tty_bytes))) - ALOGE("%s:FIONREAD %s", __func__, strerror(errno)); - ALOGV("%s:tty_bytes = %d", __func__, tty_bytes); - - uint8_t* tmp_buffer = new uint8_t[tty_bytes]; - size_t bytes_read = TEMP_FAILURE_RETRY(read(fd, tmp_buffer, tty_bytes)); - CHECK(static_cast<int>(bytes_read) == tty_bytes); - size_t bytes_written = - TEMP_FAILURE_RETRY(write(shim_fd, tmp_buffer, tty_bytes)); - CHECK(static_cast<int>(bytes_written) == tty_bytes); - delete[] tmp_buffer; - }); - - fd_watcher_.WatchFdForNonBlockingReads( - for_hci, [this](int fd) { hci_->OnDataReady(fd); }); - - cb->initializationComplete(Status::SUCCESS); - return Void(); -} - -Return<void> BluetoothHci::close() { - ALOGI("BluetoothHci::close()"); - - if (hci_tty_fd_ >= 0) { - fd_watcher_.StopWatchingFileDescriptors(); - ::close(hci_tty_fd_); - hci_tty_fd_ = -1; - } - - event_cb_->unlinkToDeath(deathRecipient); - - if (hci_ != nullptr) { - delete hci_; - hci_ = nullptr; - } - - return Void(); -} - -Return<void> BluetoothHci::sendHciCommand(const hidl_vec<uint8_t>& packet) { - hci_->Send(HCI_PACKET_TYPE_COMMAND, packet.data(), packet.size()); - return Void(); -} - -Return<void> BluetoothHci::sendAclData(const hidl_vec<uint8_t>& packet) { - hci_->Send(HCI_PACKET_TYPE_ACL_DATA, packet.data(), packet.size()); - return Void(); -} - -Return<void> BluetoothHci::sendScoData(const hidl_vec<uint8_t>& packet) { - hci_->Send(HCI_PACKET_TYPE_SCO_DATA, packet.data(), packet.size()); - return Void(); -} - -} // namespace hikey -} // namespace V1_0 -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/bluetooth_hci.h b/bluetooth/bluetooth_hci.h deleted file mode 100644 index 2f1015a0..00000000 --- a/bluetooth/bluetooth_hci.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <android/hardware/bluetooth/1.0/IBluetoothHci.h> - -#include <hidl/MQDescriptor.h> - -#include "async_fd_watcher.h" -#include "h4_protocol.h" - -namespace android { -namespace hardware { -namespace bluetooth { -namespace V1_0 { -namespace hikey { - -using ::android::hardware::Return; -using ::android::hardware::hidl_vec; - -struct BluetoothDeathRecipient : hidl_death_recipient { - BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {} - - virtual void serviceDied( - uint64_t /*cookie*/, - const wp<::android::hidl::base::V1_0::IBase>& /*who*/) { - mHci->close(); - } - sp<IBluetoothHci> mHci; -}; - -class BluetoothHci : public IBluetoothHci { - public: - BluetoothHci(); - Return<void> initialize( - const ::android::sp<IBluetoothHciCallbacks>& cb) override; - Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override; - Return<void> sendAclData(const hidl_vec<uint8_t>& packet) override; - Return<void> sendScoData(const hidl_vec<uint8_t>& packet) override; - Return<void> close() override; - - static void OnPacketReady(); - - private: - ::android::sp<IBluetoothHciCallbacks> event_cb_; - int hci_tty_fd_; - - async::AsyncFdWatcher fd_watcher_; - - hci::H4Protocol* hci_; - - ::android::sp<BluetoothDeathRecipient> deathRecipient; -}; - -} // namespace hikey -} // namespace V1_0 -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/h4_protocol.cc b/bluetooth/h4_protocol.cc deleted file mode 100644 index 8f24b5ee..00000000 --- a/bluetooth/h4_protocol.cc +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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 "h4_protocol.h" - -#define LOG_TAG "android.hardware.bluetooth-hci-h4" -#include <android-base/logging.h> -#include <assert.h> -#include <fcntl.h> - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -size_t H4Protocol::Send(uint8_t type, const uint8_t* data, size_t length) { - int rv = WriteSafely(uart_fd_, &type, sizeof(type)); - if (rv == sizeof(type)) { - rv = WriteSafely(uart_fd_, data, length); - } - return rv; -} - -void H4Protocol::OnPacketReady() { - switch (hci_packet_type_) { - case HCI_PACKET_TYPE_EVENT: - event_cb_(hci_packetizer_.GetPacket()); - break; - case HCI_PACKET_TYPE_ACL_DATA: - acl_cb_(hci_packetizer_.GetPacket()); - break; - case HCI_PACKET_TYPE_SCO_DATA: - sco_cb_(hci_packetizer_.GetPacket()); - break; - default: { - bool bad_packet_type = true; - CHECK(!bad_packet_type); - } - } - // Get ready for the next type byte. - hci_packet_type_ = HCI_PACKET_TYPE_UNKNOWN; -} - -void H4Protocol::OnDataReady(int fd) { - if (hci_packet_type_ == HCI_PACKET_TYPE_UNKNOWN) { - uint8_t buffer[1] = {0}; - size_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buffer, 1)); - CHECK(bytes_read == 1); - hci_packet_type_ = static_cast<HciPacketType>(buffer[0]); - } else { - hci_packetizer_.OnDataReady(fd, hci_packet_type_); - } -} - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/h4_protocol.h b/bluetooth/h4_protocol.h deleted file mode 100644 index 67e2b03e..00000000 --- a/bluetooth/h4_protocol.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <hidl/HidlSupport.h> - -#include "async_fd_watcher.h" -#include "hci_internals.h" -#include "hci_protocol.h" - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -class H4Protocol : public HciProtocol { - public: - H4Protocol(int fd, PacketReadCallback event_cb, PacketReadCallback acl_cb, - PacketReadCallback sco_cb) - : uart_fd_(fd), - event_cb_(event_cb), - acl_cb_(acl_cb), - sco_cb_(sco_cb), - hci_packetizer_([this]() { OnPacketReady(); }) {} - - size_t Send(uint8_t type, const uint8_t* data, size_t length); - - void OnPacketReady(); - - void OnDataReady(int fd); - - private: - int uart_fd_; - - PacketReadCallback event_cb_; - PacketReadCallback acl_cb_; - PacketReadCallback sco_cb_; - - HciPacketType hci_packet_type_{HCI_PACKET_TYPE_UNKNOWN}; - hci::HciPacketizer hci_packetizer_; -}; - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/hci_internals.h b/bluetooth/hci_internals.h deleted file mode 100644 index 1e1f3001..00000000 --- a/bluetooth/hci_internals.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright 2016 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <stdlib.h> - -// HCI UART transport packet types (Volume 4, Part A, 2) -enum HciPacketType { - HCI_PACKET_TYPE_UNKNOWN = 0, - HCI_PACKET_TYPE_COMMAND = 1, - HCI_PACKET_TYPE_ACL_DATA = 2, - HCI_PACKET_TYPE_SCO_DATA = 3, - HCI_PACKET_TYPE_EVENT = 4 -}; - -// 2 bytes for opcode, 1 byte for parameter length (Volume 2, Part E, 5.4.1) -const size_t HCI_COMMAND_PREAMBLE_SIZE = 3; -const size_t HCI_LENGTH_OFFSET_CMD = 2; - -// 2 bytes for handle, 2 bytes for data length (Volume 2, Part E, 5.4.2) -const size_t HCI_ACL_PREAMBLE_SIZE = 4; -const size_t HCI_LENGTH_OFFSET_ACL = 2; - -// 2 bytes for handle, 1 byte for data length (Volume 2, Part E, 5.4.3) -const size_t HCI_SCO_PREAMBLE_SIZE = 3; -const size_t HCI_LENGTH_OFFSET_SCO = 2; - -// 1 byte for event code, 1 byte for parameter length (Volume 2, Part E, 5.4.4) -const size_t HCI_EVENT_PREAMBLE_SIZE = 2; -const size_t HCI_LENGTH_OFFSET_EVT = 1; - -const size_t HCI_PREAMBLE_SIZE_MAX = HCI_ACL_PREAMBLE_SIZE; - -// Event codes (Volume 2, Part E, 7.7.14) -const uint8_t HCI_COMMAND_COMPLETE_EVENT = 0x0E; diff --git a/bluetooth/hci_packetizer.cc b/bluetooth/hci_packetizer.cc deleted file mode 100644 index 9549858b..00000000 --- a/bluetooth/hci_packetizer.cc +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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 "hci_packetizer.h" - -#define LOG_TAG "android.hardware.bluetooth.hci_packetizer" -#include <android-base/logging.h> -#include <utils/Log.h> - -#include <dlfcn.h> -#include <fcntl.h> - -namespace { - -const size_t preamble_size_for_type[] = { - 0, HCI_COMMAND_PREAMBLE_SIZE, HCI_ACL_PREAMBLE_SIZE, HCI_SCO_PREAMBLE_SIZE, - HCI_EVENT_PREAMBLE_SIZE}; -const size_t packet_length_offset_for_type[] = { - 0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO, - HCI_LENGTH_OFFSET_EVT}; - -size_t HciGetPacketLengthForType(HciPacketType type, const uint8_t* preamble) { - size_t offset = packet_length_offset_for_type[type]; - if (type != HCI_PACKET_TYPE_ACL_DATA) return preamble[offset]; - return (((preamble[offset + 1]) << 8) | preamble[offset]); -} - -} // namespace - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -const hidl_vec<uint8_t>& HciPacketizer::GetPacket() const { return packet_; } - -void HciPacketizer::OnDataReady(int fd, HciPacketType packet_type) { - switch (state_) { - case HCI_PREAMBLE: { - size_t bytes_read = TEMP_FAILURE_RETRY( - read(fd, preamble_ + bytes_read_, - preamble_size_for_type[packet_type] - bytes_read_)); - CHECK(bytes_read > 0); - bytes_read_ += bytes_read; - if (bytes_read_ == preamble_size_for_type[packet_type]) { - size_t packet_length = - HciGetPacketLengthForType(packet_type, preamble_); - packet_.resize(preamble_size_for_type[packet_type] + packet_length); - memcpy(packet_.data(), preamble_, preamble_size_for_type[packet_type]); - bytes_remaining_ = packet_length; - state_ = HCI_PAYLOAD; - bytes_read_ = 0; - } - break; - } - - case HCI_PAYLOAD: { - size_t bytes_read = TEMP_FAILURE_RETRY(read( - fd, - packet_.data() + preamble_size_for_type[packet_type] + bytes_read_, - bytes_remaining_)); - CHECK(bytes_read > 0); - bytes_remaining_ -= bytes_read; - bytes_read_ += bytes_read; - if (bytes_remaining_ == 0) { - packet_ready_cb_(); - state_ = HCI_PREAMBLE; - bytes_read_ = 0; - } - break; - } - } -} - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/hci_packetizer.h b/bluetooth/hci_packetizer.h deleted file mode 100644 index 90579bd2..00000000 --- a/bluetooth/hci_packetizer.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <functional> - -#include <hidl/HidlSupport.h> - -#include "hci_internals.h" - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -using ::android::hardware::hidl_vec; -using HciPacketReadyCallback = std::function<void(void)>; - -class HciPacketizer { - public: - HciPacketizer(HciPacketReadyCallback packet_cb) - : packet_ready_cb_(packet_cb){}; - void OnDataReady(int fd, HciPacketType packet_type); - const hidl_vec<uint8_t>& GetPacket() const; - - protected: - enum State { HCI_PREAMBLE, HCI_PAYLOAD }; - State state_{HCI_PREAMBLE}; - uint8_t preamble_[HCI_PREAMBLE_SIZE_MAX]; - hidl_vec<uint8_t> packet_; - size_t bytes_remaining_{0}; - size_t bytes_read_{0}; - HciPacketReadyCallback packet_ready_cb_; -}; - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/hci_protocol.cc b/bluetooth/hci_protocol.cc deleted file mode 100644 index cd709b43..00000000 --- a/bluetooth/hci_protocol.cc +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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 "hci_protocol.h" - -#define LOG_TAG "android.hardware.bluetooth-hci-hci_protocol" -#include <android-base/logging.h> -#include <assert.h> -#include <fcntl.h> -#include <utils/Log.h> - -namespace { - -const size_t preamble_size_for_type[] = { - 0, HCI_COMMAND_PREAMBLE_SIZE, HCI_ACL_PREAMBLE_SIZE, HCI_SCO_PREAMBLE_SIZE, - HCI_EVENT_PREAMBLE_SIZE}; -const size_t packet_length_offset_for_type[] = { - 0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO, - HCI_LENGTH_OFFSET_EVT}; - -size_t HciGetPacketLengthForType(HciPacketType type, const uint8_t* preamble) { - size_t offset = packet_length_offset_for_type[type]; - if (type != HCI_PACKET_TYPE_ACL_DATA) return preamble[offset]; - return (((preamble[offset + 1]) << 8) | preamble[offset]); -} - -} // namespace - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -size_t HciProtocol::WriteSafely(int fd, const uint8_t* data, size_t length) { - size_t transmitted_length = 0; - while (length > 0) { - ssize_t ret = - TEMP_FAILURE_RETRY(write(fd, data + transmitted_length, length)); - - if (ret == -1) { - if (errno == EAGAIN) continue; - ALOGE("%s error writing to UART (%s)", __func__, strerror(errno)); - break; - - } else if (ret == 0) { - // Nothing written :( - ALOGE("%s zero bytes written - something went wrong...", __func__); - break; - } - - transmitted_length += ret; - length -= ret; - } - - return transmitted_length; -} - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/hci_protocol.h b/bluetooth/hci_protocol.h deleted file mode 100644 index f76cddf5..00000000 --- a/bluetooth/hci_protocol.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// 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. -// - -#pragma once - -#include <hidl/HidlSupport.h> - -#include "hci_internals.h" -#include "hci_packetizer.h" - -namespace android { -namespace hardware { -namespace bluetooth { -namespace hci { - -using ::android::hardware::hidl_vec; -using PacketReadCallback = std::function<void(const hidl_vec<uint8_t>&)>; - -// Implementation of HCI protocol bits common to different transports -class HciProtocol { - public: - HciProtocol() = default; - virtual ~HciProtocol(){}; - - // Protocol-specific implementation of sending packets. - virtual size_t Send(uint8_t type, const uint8_t* data, size_t length) = 0; - - protected: - static size_t WriteSafely(int fd, const uint8_t* data, size_t length); -}; - -} // namespace hci -} // namespace bluetooth -} // namespace hardware -} // namespace android diff --git a/bluetooth/service.cc b/bluetooth/service.cc deleted file mode 100644 index 05920edf..00000000 --- a/bluetooth/service.cc +++ /dev/null @@ -1,40 +0,0 @@ -// -// Copyright 2017 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#define LOG_TAG "android.hardware.bluetooth@1.0-service.hikey" - -#include <android/hardware/bluetooth/1.0/IBluetoothHci.h> -#include <hidl/HidlSupport.h> -#include <hidl/HidlTransportSupport.h> -#include <utils/Log.h> - -#include "bluetooth_hci.h" - -using ::android::hardware::configureRpcThreadpool; -using ::android::hardware::bluetooth::V1_0::IBluetoothHci; -using ::android::hardware::bluetooth::V1_0::hikey::BluetoothHci; -using ::android::hardware::joinRpcThreadpool; -using ::android::sp; - -int main(int /* argc */, char** /* argv */) { - sp<IBluetoothHci> bluetooth = new BluetoothHci; - configureRpcThreadpool(1, true); - android::status_t status = bluetooth->registerAsService(); - if (status == android::OK) - joinRpcThreadpool(); - else - ALOGE("Could not register as a service!"); -} diff --git a/bootloader/Makefile b/bootloader/Makefile deleted file mode 100644 index a209e359..00000000 --- a/bootloader/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -AARCH64_TOOLCHAIN=GCC49 -EDK2_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/edk2 -UEFI_TOOLS_DIR=$(ANDROID_BUILD_TOP)/device/linaro/hikey/uefi-tools -ATF_DIR=$(ANDROID_BUILD_TOP)/device/linaro/bootloader/arm-trusted-firmware -PRODUCT_OUT?=out/target/product/hikey -DIST_DIR?=$(ANDROID_BUILD_TOP)/out/dist - -ifdef DEBUG - TARGET = DEBUG -else - TARGET = RELEASE -endif - -all: $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin - -$(DIST_DIR)/fip.bin: - cd $(EDK2_DIR) && \ - rm -rf Conf/tools_def.txt Conf/BuildEnv.sh Conf/build_rule.txt Conf/target.txt Conf/tools_def.txt && \ - export CROSS_COMPILE_32=arm-linux-androideabi- && \ - export CROSS_COMPILE_64=aarch64-linux-android- && \ - rm -rf OpenPlatformPkg && \ - ln -sf $(EDK2_DIR)/../OpenPlatformPkg OpenPlatformPkg && \ - rm -rf $(EDK2_DIR)/Build/ && \ - mkdir -p $(EDK2_DIR)/Build/ && \ - mkdir -p $(DIST_DIR) && \ - mkdir -p $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi && \ - ln -sf $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey && \ - $(UEFI_TOOLS_DIR)/uefi-build.sh -b $(TARGET) -D EDK2_OUT_DIR=$(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi -a $(ATF_DIR) hikey && \ - cp $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV/fip.bin $(DIST_DIR)/ - -$(DIST_DIR)/l-loader.bin: $(DIST_DIR)/fip.bin - cd $(ANDROID_BUILD_TOP)/device/linaro/hikey/l-loader && \ - ln -sf $(EDK2_DIR)/Build/HiKey/$(TARGET)_GCC49/FV//bl1.bin && \ - make CROSS_COMPILE=arm-linux-androideabi- hikey && \ - mv l-loader.bin $(DIST_DIR)/ - -clean: - rm -rf $(DIST_DIR)/fip.bin $(DIST_DIR)/l-loader.bin $(ANDROID_BUILD_TOP)/$(PRODUCT_OUT)/obj/uefi $(EDK2_DIR)/Build/HiKey - cd $(EDK2_DIR)/BaseTools && make clean diff --git a/bootloader/README.md b/bootloader/README.md deleted file mode 100644 index 1271cfd4..00000000 --- a/bootloader/README.md +++ /dev/null @@ -1,10 +0,0 @@ -Bootloader is build with ArmTF and UEFI from sources located at: - device/linaro/bootloader -To build fip.bin and l-loader.bin do: - $ cd device/linaro/hikey/bootloader - $ make -Results will be in out/dist - -We can also generate ptable (needs root privilege) with below commands: - $ cd device/linaro/hikey/l-loader/ - $ make ptable.img diff --git a/bt-wifi-firmware-util/NOTICE b/bt-wifi-firmware-util/NOTICE deleted file mode 100644 index e5bdc11d..00000000 --- a/bt-wifi-firmware-util/NOTICE +++ /dev/null @@ -1,72 +0,0 @@ -TEXAS INSTRUMENTS TEXT FILE LICENSE - - -Copyright (c) 2008 - 2013 Texas Instruments Incorporated - -All rights reserved not granted herein. - -Limited License. - -If you download and use any version of this software from www.github.com, you -acknowledge and agree that the terms and conditions of this license control and any -previous licenses under which this software may have been provided on www.github.com -are superseded and replaced by the terms and conditions of this license. - -Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive -license under copyrights and patents it now or hereafter owns or controls to make, -have made, use, import, offer to sell and sell ("Utilize") this software subject -to the terms herein. With respect to the foregoing patent license, such license -is granted solely to the extent that any such patent is necessary to Utilize the -software alone. The patent license shall not apply to any combinations which -include this software, other than combinations with devices manufactured by or -for TI ("TI Devices"). No hardware patent is licensed hereunder. - -Redistributions must preserve existing copyright notices and reproduce this license -(including the above copyright notice and the disclaimer and (if applicable) source -code license limitations below) in the documentation and/or other materials provided -with the distribution - -Redistribution and use in binary form, without modification, are permitted provided -that the following conditions are met: - -* No reverse engineering, decompilation, or disassembly of this software is permitted - with respect to any software provided in binary form. - -* any redistribution and use are licensed by TI for use only with TI Devices. - -* Nothing shall obligate TI to provide you with source code for the software - licensed and provided to you in object code. - -If software source code is provided to you, modification and redistribution of the -source code are permitted provided that the following conditions are met: - -* any redistribution and use of the source code, including any resulting - derivative works, are licensed by TI for use only with TI Devices. - -* any redistribution and use of any object code compiled from the source - code and any resulting derivative works, are licensed by TI for use only - with TI Devices. - -Neither the name of Texas Instruments Incorporated nor the names of its suppliers -may be used to endorse or promote products derived from this software without specific -prior written permission. - -DISCLAIMER. - -THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "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 TI AND TI'S LICENSORS 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. - -BY UTILIZING THIS SOFTWARE TO ENABLE ANT CODE EMBEDDED ON TI DEVICES, YOU -AGREE THAT NOTHING IN THIS LICENSE GIVES RISE TO ANY WARRANTY OR OTHER -OBLIGATIONS BY TI OR ITS LICENSORS WITH RESPECT TO THE ANT CODE EMBEDDED -ON TI DEVICES AND ENABLED BY THE SOFTWARE UNDER THIS LICENSE. FURTHER, YOU -AGREE THAT NOTHING IN THIS LICENSE GIVES RISE TO ANY RIGHT TO REVERSE ENGINEER, -DECOMPILE OR DISASSEMBLE THE ANT CODE EMBEDDED ON THE TI DEVICES. diff --git a/bt-wifi-firmware-util/TIInit_11.8.32-pcm-960.bts b/bt-wifi-firmware-util/TIInit_11.8.32-pcm-960.bts Binary files differdeleted file mode 100644 index ff56d1c5..00000000 --- a/bt-wifi-firmware-util/TIInit_11.8.32-pcm-960.bts +++ /dev/null diff --git a/bt-wifi-firmware-util/TIInit_11.8.32.bts b/bt-wifi-firmware-util/TIInit_11.8.32.bts Binary files differdeleted file mode 100755 index 824ca0f2..00000000 --- a/bt-wifi-firmware-util/TIInit_11.8.32.bts +++ /dev/null diff --git a/bt-wifi-firmware-util/wl18xx-conf-wl1837mod.bin b/bt-wifi-firmware-util/wl18xx-conf-wl1837mod.bin Binary files differdeleted file mode 100644 index 5dd913cc..00000000 --- a/bt-wifi-firmware-util/wl18xx-conf-wl1837mod.bin +++ /dev/null diff --git a/bt-wifi-firmware-util/wl18xx-conf.bin b/bt-wifi-firmware-util/wl18xx-conf.bin Binary files differdeleted file mode 100644 index 2bd0f4df..00000000 --- a/bt-wifi-firmware-util/wl18xx-conf.bin +++ /dev/null diff --git a/bt-wifi-firmware-util/wl18xx-fw-4.bin b/bt-wifi-firmware-util/wl18xx-fw-4.bin Binary files differdeleted file mode 100755 index 71c160ac..00000000 --- a/bt-wifi-firmware-util/wl18xx-fw-4.bin +++ /dev/null diff --git a/build/tasks/dtimage.mk b/build/tasks/dtimage.mk index 4d6a74d4..86cc290e 100644 --- a/build/tasks/dtimage.mk +++ b/build/tasks/dtimage.mk @@ -1,7 +1,11 @@ ifneq ($(filter hikey%, $(TARGET_DEVICE)),) ifneq ($(TARGET_NO_DTIMAGE), true) +# make sure the vendor package is present -MKDTIMG := device/linaro/hikey/installer/hikey960/mkdtimg +include device/linaro/hikey/vendor-package-ver.mk +ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk)) + +MKDTIMG := $(LINARO_VENDOR_PATH)/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/bootloader/mkdtimg DTB := $(PRODUCT_OUT)/hi3660-hikey960.dtb $(PRODUCT_OUT)/dt.img: $(DTB) @@ -15,3 +19,4 @@ BOARD_PACK_RADIOIMAGES += dt.img endif endif +endif diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml index 3082485c..f10b6bd5 100644 --- a/compatibility_matrix.xml +++ b/compatibility_matrix.xml @@ -1,13 +1,5 @@ <compatibility-matrix version="1.0" type="device"> <hal format="hidl" optional="false"> - <name>android.frameworks.schedulerservice</name> - <version>1.0</version> - <interface> - <name>ISchedulingPolicyService</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl" optional="false"> <name>android.frameworks.sensorservice</name> <version>1.0</version> <interface> diff --git a/device-common.mk b/device-common.mk index 7e0d09a5..0e498f46 100644 --- a/device-common.mk +++ b/device-common.mk @@ -17,6 +17,28 @@ # Enable updating of APEXes $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) +# Check vendor package version +# If you need to make changes to the vendor partition, +# please modify the source git project here: +# https://staging-git.codelinaro.org/linaro/linaro-aosp/aosp-linaro-vendor-package +include $(LOCAL_PATH)/vendor-package-ver.mk +ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk)) + # Unfortunately inherit-product doesn't export build variables from the + # called make file to the caller, so we have to include it directly here. + include $(LINARO_VENDOR_PATH)/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk + ifneq ($(TARGET_LINARO_VENDOR_VERSION), $(EXPECTED_LINARO_VENDOR_VERSION)) + $(warning TARGET_LINARO_VENDOR_VERSION ($(TARGET_LINARO_VENDOR_VERSION)) does not match exiting the build ($(EXPECTED_LINARO_VENDOR_VERSION)).) + $(warning Please download new binaries here:) + $(warning $(VND_PKG_URL) ) + $(warning And extract in the ANDROID_TOP_DIR) + endif +else + $(warning Missing Linaro Vendor Package!) + $(warning Please download new binaries here:) + $(warning $(VND_PKG_URL) ) + $(warning And extract in the ANDROID_TOP_DIR) +endif +$(warning EXPECTED_LINARO_VENDOR_VERSION=$(EXPECTED_LINARO_VENDOR_VERSION)) ifneq (,$(filter $(TARGET_PRODUCT),hikey960_tv hikey_tv)) # Setup TV Build @@ -28,15 +50,19 @@ PRODUCT_IS_ATV := true else # Adjust the dalvik heap to be appropriate for a tablet. $(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) endif # Set vendor kernel path PRODUCT_VENDOR_KERNEL_HEADERS := device/linaro/hikey/kernel-headers -PRODUCT_SHIPPING_API_LEVEL := 29 +PRODUCT_SHIPPING_API_LEVEL := 31 PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false +# Enable Scoped Storage related +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) + # Set custom settings DEVICE_PACKAGE_OVERLAYS := device/linaro/hikey/overlay ifneq (,$(filter $(TARGET_PRODUCT),hikey960_tv hikey_tv)) @@ -65,24 +91,24 @@ PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0 \ PRODUCT_RUNTIMES := runtime_libart_default # Build default bluetooth a2dp and usb audio HALs -PRODUCT_PACKAGES += audio.a2dp.default \ - audio.bluetooth.default \ +PRODUCT_PACKAGES += audio.bluetooth.default \ audio.usb.default \ audio.r_submix.default \ tinyplay PRODUCT_PACKAGES += \ - android.hardware.audio@4.0-impl:32 \ - android.hardware.audio.effect@4.0-impl:32 \ - android.hardware.audio@2.0-service \ - android.hardware.soundtrigger@2.0-impl \ + android.hardware.audio.service \ + android.hardware.audio@7.0-impl \ + android.hardware.audio.effect@7.0-impl \ + android.hardware.soundtrigger@2.3-impl \ android.hardware.bluetooth.audio@2.0-impl + PRODUCT_PACKAGES += vndk_package PRODUCT_PACKAGES += \ - android.hardware.drm@1.0-impl \ - android.hardware.drm@1.0-service + android.hardware.drm@1.3-service.clearkey \ + android.hardware.drm@1.3-service.widevine \ # Graphics HAL PRODUCT_PACKAGES += \ @@ -90,27 +116,22 @@ PRODUCT_PACKAGES += \ android.hardware.graphics.allocator@2.0-service \ android.hardware.graphics.composer@2.1-impl \ android.hardware.graphics.composer@2.1-service \ - android.hardware.graphics.mapper@2.0-impl + android.hardware.graphics.mapper@2.0-impl-2.1 \ -# Memtrack -PRODUCT_PACKAGES += memtrack.default \ - android.hardware.memtrack@1.0-service \ - android.hardware.memtrack@1.0-impl - -ifeq ($(HIKEY_USE_LEGACY_TI_BLUETOOTH), true) -PRODUCT_PACKAGES += android.hardware.bluetooth@1.0-service.hikey uim -else PRODUCT_PACKAGES += android.hardware.bluetooth@1.1-service.btlinux -endif -# PowerHAL +# +# Power HAL +# PRODUCT_PACKAGES += \ - android.hardware.power@1.1-impl \ - android.hardware.power@1.1-service.hikey-common + android.hardware.power-service.example -#GNSS HAL +# +# PowerStats HAL +# PRODUCT_PACKAGES += \ - android.hardware.gnss@1.0-impl + android.hardware.power.stats-service.example + # Software Gatekeeper HAL PRODUCT_PACKAGES += \ @@ -211,9 +232,6 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml -# Include BT modules -$(call inherit-product, device/linaro/hikey/wpan/ti-wpan-products.mk) - PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ @@ -229,8 +247,8 @@ PRODUCT_COPY_FILES += \ device/linaro/hikey/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ device/linaro/hikey/audio/audio_policy_configuration_bluetooth_legacy_hal.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_bluetooth_legacy_hal.xml \ frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration.xml \ - frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/a2dp_in_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_in_audio_policy_configuration_7_0.xml \ + frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \ frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \ frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ @@ -244,39 +262,12 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/linaro/hikey/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.common.rc \ -PRODUCT_PACKAGES += \ - android.hardware.renderscript@1.0.vndk-sp\ - android.hardware.graphics.composer@2.1.vndk-sp\ - android.hardware.graphics.allocator@2.0.vndk-sp\ - android.hardware.graphics.mapper@2.0.vndk-sp\ - android.hardware.graphics.common@1.0.vndk-sp\ - libvndksupport.vndk-sp\ - libbinder.vndk-sp\ - libhwbinder.vndk-sp\ - libbase.vndk-sp\ - libfmq.vndk-sp\ - libcutils.vndk-sp\ - libhardware.vndk-sp\ - libhidlbase.vndk-sp\ - libhidltransport.vndk-sp\ - libui.vndk-sp\ - libutils.vndk-sp\ - libc++.vndk-sp\ - libRS_internal.vndk-sp\ - libRSDriver.vndk-sp\ - libRSCpuRef.vndk-sp\ - libbcinfo.vndk-sp\ - libblas.vndk-sp\ - libft2.vndk-sp\ - libpng.vndk-sp\ - libcompiler_rt.vndk-sp\ - libbacktrace.vndk-sp\ - libunwind.vndk-sp\ - libunwindstack.vndk-sp\ - liblzma.vndk-sp\ - libion.vndk-sp\ # Health PRODUCT_PACKAGES += \ - android.hardware.health@2.0-service \ - android.hardware.health@2.0-impl + android.hardware.health@2.1-impl-cuttlefish \ + android.hardware.health@2.1-service + +# TODO: disable this service once we implement system suspend +PRODUCT_PACKAGES += \ + suspend_blocker diff --git a/fetch-vendor-package.sh b/fetch-vendor-package.sh new file mode 100755 index 00000000..cbadbdeb --- /dev/null +++ b/fetch-vendor-package.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# fetch, check & extract the current vendor package +set -e + +DIR_PARENT=$(cd $(dirname $0); pwd) +if [ -z "${ANDROID_BUILD_TOP}" ]; then + ANDROID_BUILD_TOP=$(cd ${DIR_PARENT}/../../../; pwd) +fi + +. "${ANDROID_BUILD_TOP}/device/linaro/hikey/vendor-package-ver.sh" + +PKG_FILE=extract-linaro_devices-${EXPECTED_LINARO_VENDOR_VERSION} + +pushd ${ANDROID_BUILD_TOP} + +if [ ! -e "${PKG_FILE}.tgz" ]; then + curl -L ${VND_PKG_URL} -o ${PKG_FILE}.tgz +fi + +# generate expected sha512sum, check & cleanup +echo "${EXPECTED_LINARO_VENDOR_SHA} ${PKG_FILE}.tgz" > ${PKG_FILE}.tgz.sha +sha512sum -c ${PKG_FILE}.tgz.sha +rm ${PKG_FILE}.tgz.sha + +tar -xf ${PKG_FILE}.tgz +./${PKG_FILE}.sh +popd diff --git a/gralloc/Android.bp b/gralloc/Android.bp index a198df52..aaca7cbd 100644 --- a/gralloc/Android.bp +++ b/gralloc/Android.bp @@ -1,6 +1,18 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_linaro_hikey_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + // SPDX-license-identifier-GPL-2.0 + default_applicable_licenses: ["device_linaro_hikey_license"], +} + cc_library_shared { name: "hwcomposer.drm_hikey", defaults: ["hwcomposer.drm_defaults"], - srcs: [":drm_hwcomposer_platformhisi"], - whole_static_libs: ["drm_hwcomposer"], + srcs: [ + ":drm_hwcomposer_common", + ":drm_hwcomposer_platformhisi", + ], } diff --git a/gralloc/Android.mk b/gralloc/Android.mk index 23a5a820..947a184c 100644 --- a/gralloc/Android.mk +++ b/gralloc/Android.mk @@ -29,6 +29,8 @@ LOCAL_VENDOR_MODULE := true MALI_DDK_TEST_PATH := hardware/arm/ LOCAL_MODULE := gralloc.hikey +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0 +LOCAL_LICENSE_CONDITIONS := notice restricted LOCAL_MODULE_RELATIVE_PATH := hw #LOCAL_MODULE_TAGS := optional @@ -52,8 +54,6 @@ LOCAL_SRC_FILES := \ #LOCAL_CFLAGS+= -DMALI_VSYNC_EVENT_REPORT_ENABLE -ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true) LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL -endif include $(BUILD_SHARED_LIBRARY) diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp index b6bd69ea..f458a624 100644 --- a/gralloc/alloc_device.cpp +++ b/gralloc/alloc_device.cpp @@ -20,6 +20,9 @@ #include <string.h> #include <errno.h> #include <pthread.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> #include <cutils/log.h> #include <cutils/atomic.h> @@ -41,10 +44,22 @@ #if GRALLOC_ARM_DMA_BUF_MODULE #include <ion/ion.h> #include "ion_4.12.h" +#include "dma-heap.h" #define ION_SYSTEM (char*)"ion_system_heap" #define ION_CMA (char*)"linux,cma" +#define DMABUF_SYSTEM (char*)"system" +#define DMABUF_CMA (char*)"linux,cma" +static enum { + INTERFACE_UNKNOWN, + INTERFACE_ION_LEGACY, + INTERFACE_ION_MODERN, + INTERFACE_DMABUF_HEAPS +} interface_ver; + +static int system_heap_id; +static int cma_heap_id; #endif #if GRALLOC_SIMULATE_FAILURES @@ -119,12 +134,73 @@ static int fb_get_framebuffer_dmabuf(private_module_t *m, private_handle_t *hnd) } #endif +#if GRALLOC_ARM_DMA_BUF_MODULE +#define DEVPATH "/dev/dma_heap" +int dma_heap_open(const char* name) +{ + int ret, fd; + char buf[256]; + + ret = sprintf(buf, "%s/%s", DEVPATH, name); + if (ret < 0) { + AERR("sprintf failed!\n"); + return ret; + } + + fd = open(buf, O_RDONLY); + if (fd < 0) + AERR("open %s failed!\n", buf); + return fd; +} + +int dma_heap_alloc(int fd, size_t len, unsigned int flags, int *dmabuf_fd) +{ + struct dma_heap_allocation_data data = { + .len = len, + .fd_flags = O_RDWR | O_CLOEXEC, + .heap_flags = flags, + }; + int ret; + + if (dmabuf_fd == NULL) + return -EINVAL; + + ret = ioctl(fd, DMA_HEAP_IOCTL_ALLOC, &data); + if (ret < 0) + return ret; + *dmabuf_fd = (int)data.fd; + return ret; +} + +static int alloc_ion_fd(int ion_fd, size_t size, unsigned int heap_mask, unsigned int flags, int *shared_fd) +{ + int heap; + + if (interface_ver == INTERFACE_DMABUF_HEAPS) { + int fd = system_heap_id; + unsigned long flg = 0; + if (heap_mask == ION_HEAP_TYPE_DMA_MASK) + fd = cma_heap_id; + + return dma_heap_alloc(fd, size, flg, shared_fd); + } + + if (interface_ver == INTERFACE_ION_MODERN) { + heap = 1 << system_heap_id; + if (heap_mask == ION_HEAP_TYPE_DMA_MASK) + heap = 1 << cma_heap_id; + } else { + heap = heap_mask; + } + return ion_alloc_fd(ion_fd, size, 0, heap, flags, shared_fd); +} +#endif + static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buffer_handle_t *pHandle) { #if GRALLOC_ARM_DMA_BUF_MODULE { private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); - ion_user_handle_t ion_hnd; void *cpu_ptr = MAP_FAILED; int shared_fd; int ret; @@ -132,8 +208,7 @@ static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buf int lock_state = 0; int map_mask = 0; - if (usage & GRALLOC_USAGE_PROTECTED) - { + if (usage & GRALLOC_USAGE_PROTECTED) { #if defined(ION_HEAP_SECURE_MASK) heap_mask = ION_HEAP_SECURE_MASK; #else @@ -141,57 +216,17 @@ static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buf return -1; #endif } - else - { - heap_mask = ION_HEAP_SYSTEM_MASK; + else if (usage & GRALLOC_USAGE_HW_FB) { + heap_mask = ION_HEAP_TYPE_DMA_MASK; } - - if (m->gralloc_legacy_ion) - { - if (usage & GRALLOC_USAGE_HW_FB) - ret = ion_alloc(m->ion_client, size, 0, ION_HEAP_TYPE_DMA_MASK, 0, &(ion_hnd)); - else - ret = ion_alloc(m->ion_client, size, 0, ION_HEAP_SYSTEM_MASK, 0, &(ion_hnd)); - - if (ret != 0) - { - AERR("Failed to ion_alloc from ion_client:%d", m->ion_client); - return -1; - } - - ret = ion_share(m->ion_client, ion_hnd, &shared_fd); - - if (ret != 0) - { - AERR("ion_share( %d ) failed", m->ion_client); - - if (0 != ion_free(m->ion_client, ion_hnd)) - { - AERR("ion_free( %d ) failed", m->ion_client); - } - - return -1; - } - - // we do not need ion_hnd once we have shared_fd - if (0 != ion_free(m->ion_client, ion_hnd)) - { - AWAR("ion_free( %d ) failed", m->ion_client); - } - ion_hnd = ION_INVALID_HANDLE; + else { + heap_mask = ION_HEAP_SYSTEM_MASK; } - else - { - if (usage & GRALLOC_USAGE_HW_FB) - ret = ion_alloc_fd(m->ion_client, size, 0, 1 << m->cma_heap_id, 0, &(shared_fd)); - else - ret = ion_alloc_fd(m->ion_client, size, 0, 1 << m->system_heap_id, 0, &(shared_fd)); - if (ret != 0) - { - AERR("Failed to ion_alloc_fd from ion_client:%d", m->ion_client); - return -1; - } + ret = alloc_ion_fd(m->ion_client, size, heap_mask, 0, &shared_fd); + if (ret != 0) { + AERR("Failed to ion_alloc_fd from ion_client:%d", m->ion_client); + return -1; } if (!(usage & GRALLOC_USAGE_PROTECTED)) @@ -693,7 +728,7 @@ static int alloc_device_close(struct hw_device_t *device) } #if GRALLOC_ARM_DMA_BUF_MODULE -static int find_ion_heap_id(int ion_client, char* name) +static int find_heap_id(int ion_client, char* name) { int i, ret, cnt, heap_id = -1; struct ion_heap_data *data; @@ -740,6 +775,52 @@ static int find_ion_heap_id(int ion_client, char* name) } #endif +static int initialize_interface(private_module_t *m) +{ + int fd; + + if (interface_ver != INTERFACE_UNKNOWN) + return 0; + + /* test for dma-heaps*/ + fd = dma_heap_open(DMABUF_SYSTEM); + if (fd >= 0) { + AINF("Using DMA-BUF Heaps.\n"); + interface_ver = INTERFACE_DMABUF_HEAPS; + system_heap_id = fd; + cma_heap_id = dma_heap_open(DMABUF_CMA); + /* Open other dma heaps here */ + return 0; + } + + /* test for modern vs legacy ION */ + m->ion_client = ion_open(); + if (m->ion_client < 0) { + AERR("ion_open failed with %s", strerror(errno)); + return -1; + } + if (!ion_is_legacy(m->ion_client)) { + system_heap_id = find_heap_id(m->ion_client, ION_SYSTEM); + cma_heap_id = find_heap_id(m->ion_client, ION_CMA); + if (system_heap_id < 0) { + ion_close(m->ion_client); + m->ion_client = -1; + AERR( "ion_open failed: no system heap found" ); + return -1; + } + if (cma_heap_id < 0) { + AERR("No cma heap found, falling back to system"); + cma_heap_id = system_heap_id; + } + AINF("Using ION Modern interface.\n"); + interface_ver = INTERFACE_ION_MODERN; + } else { + AINF("Using ION Legacy interface.\n"); + interface_ver = INTERFACE_ION_LEGACY; + } + return 0; +} + int alloc_device_open(hw_module_t const *module, const char *name, hw_device_t **device) { MALI_IGNORE(name); @@ -777,30 +858,11 @@ int alloc_device_open(hw_module_t const *module, const char *name, hw_device_t * #if GRALLOC_ARM_DMA_BUF_MODULE private_module_t *m = reinterpret_cast<private_module_t *>(dev->common.module); - m->ion_client = ion_open(); - if (m->ion_client < 0) - { - AERR("ion_open failed with %s", strerror(errno)); + if (initialize_interface(m) < 0) { delete dev; return -1; } - - m->gralloc_legacy_ion = ion_is_legacy(m->ion_client); - - if (!m->gralloc_legacy_ion) - { - m->system_heap_id = find_ion_heap_id(m->ion_client, ION_SYSTEM); - m->cma_heap_id = find_ion_heap_id(m->ion_client, ION_CMA); - if (m->system_heap_id < 0 || m->cma_heap_id < 0) - { - delete dev; - ion_close(m->ion_client); - m->ion_client = -1; - return -1; - } - } - #endif *device = &dev->common; diff --git a/gralloc/dma-heap.h b/gralloc/dma-heap.h new file mode 100644 index 00000000..6f84fa08 --- /dev/null +++ b/gralloc/dma-heap.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * DMABUF Heaps Userspace API + * + * Copyright (C) 2011 Google, Inc. + * Copyright (C) 2019 Linaro Ltd. + */ +#ifndef _UAPI_LINUX_DMABUF_POOL_H +#define _UAPI_LINUX_DMABUF_POOL_H + +#include <linux/ioctl.h> +#include <linux/types.h> + +/** + * DOC: DMABUF Heaps Userspace API + */ + +/* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */ +#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE) + +/* Currently no heap flags */ +#define DMA_HEAP_VALID_HEAP_FLAGS (0) + +/** + * struct dma_heap_allocation_data - metadata passed from userspace for + * allocations + * @len: size of the allocation + * @fd: will be populated with a fd which provides the + * handle to the allocated dma-buf + * @fd_flags: file descriptor flags used when allocating + * @heap_flags: flags passed to heap + * + * Provided by userspace as an argument to the ioctl + */ +struct dma_heap_allocation_data { + __u64 len; + __u32 fd; + __u32 fd_flags; + __u64 heap_flags; +}; + +#define DMA_HEAP_IOC_MAGIC 'H' + +/** + * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool + * + * Takes a dma_heap_allocation_data struct and returns it with the fd field + * populated with the dmabuf handle of the allocation. + */ +#define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\ + struct dma_heap_allocation_data) + +#endif /* _UAPI_LINUX_DMABUF_POOL_H */ diff --git a/gralloc960/Android.bp b/gralloc960/Android.bp index 37d60a16..6939a52f 100644 --- a/gralloc960/Android.bp +++ b/gralloc960/Android.bp @@ -1,6 +1,18 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_linaro_hikey_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + // SPDX-license-identifier-GPL-2.0 + default_applicable_licenses: ["device_linaro_hikey_license"], +} + cc_library_shared { name: "hwcomposer.drm_hikey960", defaults: ["hwcomposer.drm_defaults"], - srcs: [":drm_hwcomposer_platformhisi"], - whole_static_libs: ["drm_hwcomposer"], + srcs: [ + ":drm_hwcomposer_common", + ":drm_hwcomposer_platformhisi", + ], } diff --git a/gralloc960/Android.hikey960.mk b/gralloc960/Android.hikey960.mk index 8b0b1bea..57b4f3e2 100644 --- a/gralloc960/Android.hikey960.mk +++ b/gralloc960/Android.hikey960.mk @@ -52,8 +52,6 @@ GRALLOC_DISP_H=0 # Vsync backend(not used) GRALLOC_VSYNC_BACKEND=default -ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true) - GRALLOC_USE_ION_DMA_HEAP=1 - GRALLOC_DISABLE_FRAMEBUFFER_HAL=1 -endif +GRALLOC_USE_ION_DMA_HEAP=1 +GRALLOC_DISABLE_FRAMEBUFFER_HAL=1 diff --git a/gralloc960/Android.mk b/gralloc960/Android.mk index 35bdb8f9..89f5857c 100644 --- a/gralloc960/Android.mk +++ b/gralloc960/Android.mk @@ -153,6 +153,8 @@ LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE := gralloc.hikey960 +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0 +LOCAL_LICENSE_CONDITIONS := notice restricted LOCAL_MODULE_TAGS := optional LOCAL_MULTILIB := both diff --git a/gralloc960/dma-heap.h b/gralloc960/dma-heap.h new file mode 100644 index 00000000..6f84fa08 --- /dev/null +++ b/gralloc960/dma-heap.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * DMABUF Heaps Userspace API + * + * Copyright (C) 2011 Google, Inc. + * Copyright (C) 2019 Linaro Ltd. + */ +#ifndef _UAPI_LINUX_DMABUF_POOL_H +#define _UAPI_LINUX_DMABUF_POOL_H + +#include <linux/ioctl.h> +#include <linux/types.h> + +/** + * DOC: DMABUF Heaps Userspace API + */ + +/* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */ +#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE) + +/* Currently no heap flags */ +#define DMA_HEAP_VALID_HEAP_FLAGS (0) + +/** + * struct dma_heap_allocation_data - metadata passed from userspace for + * allocations + * @len: size of the allocation + * @fd: will be populated with a fd which provides the + * handle to the allocated dma-buf + * @fd_flags: file descriptor flags used when allocating + * @heap_flags: flags passed to heap + * + * Provided by userspace as an argument to the ioctl + */ +struct dma_heap_allocation_data { + __u64 len; + __u32 fd; + __u32 fd_flags; + __u64 heap_flags; +}; + +#define DMA_HEAP_IOC_MAGIC 'H' + +/** + * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool + * + * Takes a dma_heap_allocation_data struct and returns it with the fd field + * populated with the dmabuf handle of the allocation. + */ +#define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\ + struct dma_heap_allocation_data) + +#endif /* _UAPI_LINUX_DMABUF_POOL_H */ diff --git a/gralloc960/mali_gralloc_ion.cpp b/gralloc960/mali_gralloc_ion.cpp index 5fb51797..c40dc7b3 100644 --- a/gralloc960/mali_gralloc_ion.cpp +++ b/gralloc960/mali_gralloc_ion.cpp @@ -45,12 +45,21 @@ #include "mali_gralloc_usages.h" #include "mali_gralloc_bufferdescriptor.h" #include "ion_4.12.h" - +#include "dma-heap.h" #define ION_SYSTEM (char*)"ion_system_heap" #define ION_CMA (char*)"linux,cma" -static bool gralloc_legacy_ion; + +#define DMABUF_SYSTEM (char*)"system" +#define DMABUF_CMA (char*)"linux,cma" +static enum { + INTERFACE_UNKNOWN, + INTERFACE_ION_LEGACY, + INTERFACE_ION_MODERN, + INTERFACE_DMABUF_HEAPS +} interface_ver; + static int system_heap_id; static int cma_heap_id; @@ -150,18 +159,63 @@ static int find_heap_id(int ion_client, char *name) return heap_id; } +#define DEVPATH "/dev/dma_heap" +int dma_heap_open(const char* name) +{ + int ret, fd; + char buf[256]; + + ret = sprintf(buf, "%s/%s", DEVPATH, name); + if (ret < 0) { + AERR("sprintf failed!\n"); + return ret; + } + + fd = open(buf, O_RDONLY); + if (fd < 0) + AERR("open %s failed!\n", buf); + return fd; +} + +int dma_heap_alloc(int fd, size_t len, unsigned int flags, int *dmabuf_fd) +{ + struct dma_heap_allocation_data data = { + .len = len, + .fd_flags = O_RDWR | O_CLOEXEC, + .heap_flags = flags, + }; + int ret; + + if (dmabuf_fd == NULL) + return -EINVAL; + + ret = ioctl(fd, DMA_HEAP_IOCTL_ALLOC, &data); + if (ret < 0) + return ret; + *dmabuf_fd = (int)data.fd; + return ret; +} + static int alloc_ion_fd(int ion_fd, size_t size, unsigned int heap_mask, unsigned int flags, int *shared_fd) { int heap; - if (!gralloc_legacy_ion) { + if (interface_ver == INTERFACE_DMABUF_HEAPS) { + int fd = system_heap_id; + unsigned long flg = 0; + if (heap_mask == ION_HEAP_TYPE_DMA_MASK) + fd = cma_heap_id; + + return dma_heap_alloc(fd, size, flg, shared_fd); + } + + if (interface_ver == INTERFACE_ION_MODERN) { heap = 1 << system_heap_id; if (heap_mask == ION_HEAP_TYPE_DMA_MASK) heap = 1 << cma_heap_id; } else { heap = heap_mask; } - return ion_alloc_fd(ion_fd, size, 0, heap, flags, shared_fd); } @@ -170,10 +224,11 @@ static int alloc_from_ion_heap(int ion_fd, size_t size, unsigned int heap_mask, ion_user_handle_t ion_hnd = -1; int shared_fd, ret; - if ((ion_fd < 0) || (size <= 0) || (heap_mask == 0) || (min_pgsz == NULL)) - { + if ((interface_ver != INTERFACE_DMABUF_HEAPS) && (ion_fd < 0)) + return -1; + + if ((size <= 0) || (heap_mask == 0) || (min_pgsz == NULL)) return -1; - } ret = alloc_ion_fd(ion_fd, size, heap_mask, flags, &(shared_fd)); if (ret < 0) @@ -378,6 +433,55 @@ static int get_max_buffer_descriptor_index(const gralloc_buffer_descriptor_t *de return max_buffer_index; } + + +static int initialize_interface(mali_gralloc_module *m) +{ + int fd; + + if (interface_ver != INTERFACE_UNKNOWN) + return 0; + + /* test for dma-heaps*/ + fd = dma_heap_open(DMABUF_SYSTEM); + if (fd >= 0) { + AINF("Using DMA-BUF Heaps.\n"); + interface_ver = INTERFACE_DMABUF_HEAPS; + system_heap_id = fd; + cma_heap_id = dma_heap_open(DMABUF_CMA); + /* Open other dma heaps here */ + return 0; + } + + /* test for modern vs legacy ION */ + m->ion_client = ion_open(); + if (m->ion_client < 0) { + AERR("ion_open failed with %s", strerror(errno)); + return -1; + } + if (!ion_is_legacy(m->ion_client)) { + system_heap_id = find_heap_id(m->ion_client, ION_SYSTEM); + cma_heap_id = find_heap_id(m->ion_client, ION_CMA); + if (system_heap_id < 0) { + ion_close(m->ion_client); + m->ion_client = -1; + AERR( "ion_open failed: no system heap found" ); + return -1; + } + if (cma_heap_id < 0) { + AERR("No cma heap found, falling back to system"); + cma_heap_id = system_heap_id; + } + AINF("Using ION Modern interface.\n"); + interface_ver = INTERFACE_ION_MODERN; + } else { + AINF("Using ION Legacy interface.\n"); + interface_ver = INTERFACE_ION_LEGACY; + } + return 0; +} + + int mali_gralloc_ion_allocate(mali_gralloc_module *m, const gralloc_buffer_descriptor_t *descriptors, uint32_t numDescriptors, buffer_handle_t *pHandle, bool *shared_backend) { @@ -389,33 +493,17 @@ int mali_gralloc_ion_allocate(mali_gralloc_module *m, const gralloc_buffer_descr int shared_fd, ret, ion_flags = 0; int min_pgsz = 0; - if (m->ion_client < 0) - { - m->ion_client = ion_open(); + ret = initialize_interface(m); + if (ret) + return ret; - if (m->ion_client < 0) - { + /* we may need to reopen the /dev/ion device */ + if ((interface_ver != INTERFACE_DMABUF_HEAPS) && (m->ion_client < 0)) { + m->ion_client = ion_open(); + if (m->ion_client < 0) { AERR("ion_open failed with %s", strerror(errno)); return -1; } - - gralloc_legacy_ion = ion_is_legacy(m->ion_client); - if (!gralloc_legacy_ion) - { - system_heap_id = find_heap_id(m->ion_client, ION_SYSTEM); - cma_heap_id = find_heap_id(m->ion_client, ION_CMA); - if (system_heap_id < 0) - { - ion_close(m->ion_client); - m->ion_client = -1; - AERR( "ion_open failed: no system heap found" ); - return -1; - } - if (cma_heap_id < 0) { - AERR("No cma heap found, falling back to system"); - cma_heap_id = system_heap_id; - } - } } *shared_backend = check_buffers_sharable(descriptors, numDescriptors); @@ -603,7 +691,7 @@ static void mali_gralloc_ion_free_internal(buffer_handle_t *pHandle, uint32_t nu void mali_gralloc_ion_sync(const mali_gralloc_module *m, private_handle_t *hnd) { - if (!gralloc_legacy_ion) + if (interface_ver != INTERFACE_ION_LEGACY) return; if (m != NULL && hnd != NULL) @@ -644,23 +732,6 @@ int mali_gralloc_ion_map(private_handle_t *hnd) break; } - /* the test condition is set to m->ion_client <= 0 here, because: - * 1) module structure are initialized to 0 if no initial value is applied - * 2) a second user process should get a ion fd greater than 0. - */ - if (m->ion_client <= 0) - { - /* a second user process must obtain a client handle first via ion_open before it can obtain the shared ion buffer*/ - m->ion_client = ion_open(); - - if (m->ion_client < 0) - { - AERR("Could not open ion device for handle: %p", hnd); - retval = -errno; - break; - } - } - mappedAddress = (unsigned char *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, hnd->share_fd, 0); if (MAP_FAILED == mappedAddress) diff --git a/hifi/Android.mk b/hifi/Android.mk deleted file mode 100644 index f3377fec..00000000 --- a/hifi/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2017 The Android Open Source Project -# -# 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 $(all-subdir-makefiles) diff --git a/hifi/debug-hifi/Android.mk b/hifi/debug-hifi/Android.mk deleted file mode 100644 index 8e55d9ae..00000000 --- a/hifi/debug-hifi/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2017 The Android Open Source Project -# -# 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 - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := debug-hifi -LOCAL_SHARED_LIBRARIES := liblog libcutils -LOCAL_SRC_FILES := debug-hifi.c -include $(BUILD_EXECUTABLE) diff --git a/hifi/debug-hifi/debug-hifi.c b/hifi/debug-hifi/debug-hifi.c deleted file mode 100644 index 75bda4cf..00000000 --- a/hifi/debug-hifi/debug-hifi.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "debug-hifi" -#include <errno.h> -#include <fcntl.h> -#include <unistd.h> -#include <poll.h> -#include <pthread.h> -#include <sys/ioctl.h> -#include <sys/prctl.h> -#include <stdio.h> -#include <cutils/log.h> -#include <cutils/uevent.h> -#include <stdlib.h> -#include <linux/audio_hifi.h> - -int main(int argc, char *argv[]) -{ - char *buffer; - int hifi_dsp_fd; - int ret = -1; - int i = 0; - unsigned int memsize = DRV_DSP_UART_TO_MEM_SIZE; - unsigned int clear = 0; - struct misc_io_dump_buf_param dump_buf; - - ALOGI("Enter hifi-dsp Audio Framework - sample application\n"); - if (argc > 1) - memsize = strtoul(argv[1], NULL, 0); - if (argc > 2) - clear = 1; - hifi_dsp_fd = open(HIFI_DSP_MISC_DRIVER, O_RDWR, 0); - if (hifi_dsp_fd < 0) { - ALOGE("Error %d opening hifi dsp device", errno); - return ret; - } - buffer = malloc(memsize); - if (!buffer) { - ALOGE("Error allocating buffer"); - goto out0; - } - dump_buf.user_buf = (uint64_t)buffer; - dump_buf.buf_size = memsize; - dump_buf.clear = clear; - ret = ioctl(hifi_dsp_fd, HIFI_MISC_IOCTL_DISPLAY_MSG, &dump_buf); - if (ret < 0) { /* This IOCTL returns buffer size */ - ALOGE("Error %d accessing message buffer", errno); - } else { - printf("%s\n", ret > 0 ? buffer : "Buffer is empty"); - } - free(buffer); -out0: - close(hifi_dsp_fd); - ALOGI("Exit hifi-dsp Audio Framework - sample application\n"); - return ret; -} diff --git a/hifi/firmware/hifi-hikey960.img b/hifi/firmware/hifi-hikey960.img Binary files differdeleted file mode 100644 index b8c25169..00000000 --- a/hifi/firmware/hifi-hikey960.img +++ /dev/null diff --git a/hifi/xaf/Android.mk b/hifi/xaf/Android.mk deleted file mode 100644 index f3377fec..00000000 --- a/hifi/xaf/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2017 The Android Open Source Project -# -# 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 $(all-subdir-makefiles) diff --git a/hifi/xaf/README b/hifi/xaf/README deleted file mode 100755 index 9c835768..00000000 --- a/hifi/xaf/README +++ /dev/null @@ -1,39 +0,0 @@ - -. -|--- README -| - This file -| -|--- release.txt -| - Release notes -| -|--- config -| | -| |--- hifi3_hikey960_linux.tgz -| | - HiKey960 HiFi3 LX6 config with SW upgraded to RG.5 tools for Linux -| | -| |-- hifi3_hikey960_win32.tgz -| - HiKey960 HiFi3 LX6 config with SW upgraded to RG.5 tools for Windows -| -|--- docs -| | -| |--- HiFi-AF-Hosted-ProgrammersGuide.pdf -| | - Xtensa Audio Framework (Hosted) Programmers Guide, v0.6 -| | -| |--- HiFi-Audio-Codec-API-Definition.pdf -| | - HiFi Audio Codec API Definition, v1.0 -| | -| |--- HiFi-Speech-Codec-API-Definition.pdf -| | - HiFi Speech Codec API Definition, v1.0 -| | -| |-- HiKey960-HiFi3-Android-SDK-Guide.pdf -| - HiKey960-HiFi3-Android-SDK Guide, v0.7 -| -|--- xaf-dsp-v0.7_Alpha.tgz -| - XAF DSP Firmware Source Code(hifi-dpf) -| -|-- xaf-host-v0.7_Alpha.tgz -| - XAF Host application Source Code(host-apf) -| -|-- Get xtensa tools and guide to install xtensa tools,HiKey960 HiFi3 LX6 config -| -https://www.tensilicatools.com/platform/huawei-kirin-960/ -| diff --git a/hifi/xaf/config/hifi3_hikey960_linux.tgz b/hifi/xaf/config/hifi3_hikey960_linux.tgz Binary files differdeleted file mode 100755 index 81152190..00000000 --- a/hifi/xaf/config/hifi3_hikey960_linux.tgz +++ /dev/null diff --git a/hifi/xaf/config/hifi3_hikey960_win32.tgz b/hifi/xaf/config/hifi3_hikey960_win32.tgz Binary files differdeleted file mode 100755 index 32871752..00000000 --- a/hifi/xaf/config/hifi3_hikey960_win32.tgz +++ /dev/null diff --git a/hifi/xaf/docs/HiFi-AF-Hosted-ProgrammersGuide.pdf b/hifi/xaf/docs/HiFi-AF-Hosted-ProgrammersGuide.pdf Binary files differdeleted file mode 100755 index 3499a875..00000000 --- a/hifi/xaf/docs/HiFi-AF-Hosted-ProgrammersGuide.pdf +++ /dev/null diff --git a/hifi/xaf/docs/HiFi-Audio-Codec-API-Definition.pdf b/hifi/xaf/docs/HiFi-Audio-Codec-API-Definition.pdf Binary files differdeleted file mode 100755 index 179d13b3..00000000 --- a/hifi/xaf/docs/HiFi-Audio-Codec-API-Definition.pdf +++ /dev/null diff --git a/hifi/xaf/docs/HiFi-Speech-Codec-API-Definition.pdf b/hifi/xaf/docs/HiFi-Speech-Codec-API-Definition.pdf Binary files differdeleted file mode 100755 index 2b6a68ac..00000000 --- a/hifi/xaf/docs/HiFi-Speech-Codec-API-Definition.pdf +++ /dev/null diff --git a/hifi/xaf/docs/HiKey960-HiFi3-Android-SDK-Guide.pdf b/hifi/xaf/docs/HiKey960-HiFi3-Android-SDK-Guide.pdf Binary files differdeleted file mode 100755 index ea3c07a4..00000000 --- a/hifi/xaf/docs/HiKey960-HiFi3-Android-SDK-Guide.pdf +++ /dev/null diff --git a/hifi/xaf/docs/Hosted_XAF_Arch_v0.7.pdf b/hifi/xaf/docs/Hosted_XAF_Arch_v0.7.pdf Binary files differdeleted file mode 100755 index f5b372f4..00000000 --- a/hifi/xaf/docs/Hosted_XAF_Arch_v0.7.pdf +++ /dev/null diff --git a/hifi/xaf/hifi-dpf/app/xa-factory.c b/hifi/xaf/hifi-dpf/app/xa-factory.c deleted file mode 100644 index b9e7d193..00000000 --- a/hifi/xaf/hifi-dpf/app/xa-factory.c +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-factory.c - * - * DSP processing framework core - component factory - * - ******************************************************************************/ - -#define MODULE_TAG FACTORY - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#include "audio/xa_type_def.h" - -/******************************************************************************* - * Tracing tags - ******************************************************************************/ - -/* ...general initialization sequence */ -TRACE_TAG(INIT, 1); - -/******************************************************************************* - * Local types definitions - ******************************************************************************/ - -/* ...component descriptor */ -typedef struct xf_component_id -{ - /* ...class id (string identifier) */ - const char *id; - - /* ...class constructor */ - xf_component_t * (*factory)(u32 core, xa_codec_func_t process); - - /* ...component API function */ - xa_codec_func_t *process; - -} xf_component_id_t; - -/******************************************************************************* - * External functions - ******************************************************************************/ - -/* ...components API functions */ -extern XA_ERRORCODE xa_pcm_codec(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_mp3_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_aac_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_aac_encoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_vorbis_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_ac3_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_ddplus71_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_mixer(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_renderer(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_capturer(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_src_pp_fx(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_dts_hd_decoder(xa_codec_handle_t, WORD32, WORD32, pVOID); -extern XA_ERRORCODE xa_dap_fx(xa_codec_handle_t, WORD32, WORD32, pVOID); - -/* ...component class factories */ -extern xf_component_t * xa_audio_codec_factory(u32 core, xa_codec_func_t process); -extern xf_component_t * xa_audio_fx_factory(u32 core, xa_codec_func_t process); -extern xf_component_t * xa_mixer_factory(u32 core, xa_codec_func_t process); -extern xf_component_t * xa_renderer_factory(u32 core,xa_codec_func_t process); - -/******************************************************************************* - * Local constants definitions - ******************************************************************************/ - -/* ...component class id */ -static const xf_component_id_t xf_component_id[] = -{ -#if XA_PCM - { "audio-decoder/pcm", xa_audio_codec_factory, xa_pcm_codec }, -#endif -#if XA_MP3_DECODER - { "audio-decoder/mp3", xa_audio_codec_factory, xa_mp3_decoder }, -#endif -#if XA_AAC_DECODER - { "audio-decoder/aac", xa_audio_codec_factory, xa_aac_decoder }, -#endif -#if XA_AC3_DECODER - { "audio-decoder/ac3", xa_audio_codec_factory, xa_ac3_decoder }, -#endif -#if XA_DDP71_DECODER - { "audio-decoder/ddplus71", xa_audio_codec_factory, xa_ddplus71_decoder }, -#endif -#if XA_DTS_HD_DECODER - { "audio-decoder/dts-hd", xa_audio_codec_factory, xa_dts_hd_decoder }, -#endif -#if XA_VORBIS_DECODER - { "audio-decoder/vorbis", xa_audio_codec_factory, xa_vorbis_decoder }, -#endif -#if XA_AAC_ENCODER - { "audio-encoder/aac", xa_audio_codec_factory, xa_aac_encoder }, -#endif -#if XA_SRC_PP_FX - { "audio-fx/src-pp", xa_audio_codec_factory, xa_src_pp_fx }, -#endif -#if XA_DAP_FX - { "audio-fx/dap", xa_audio_codec_factory, xa_dap_fx }, -#endif -#if XA_MIXER - { "mixer", xa_mixer_factory, xa_mixer }, -#endif -#if XA_RENDERER - { "renderer", xa_renderer_factory, xa_renderer }, -#endif -#if XA_CAPTURER - { "capturer", xa_capturer_factory, xa_capturer }, -#endif -}; - -/* ...number of items in the map */ -#define XF_COMPONENT_ID_MAX (sizeof(xf_component_id) / sizeof(xf_component_id[0])) - -/******************************************************************************* - * Enry points - ******************************************************************************/ - -xf_component_t * xf_component_factory(u32 core, xf_id_t id, u32 length) -{ - u32 i; - - /* ...find component-id in static map */ - for (i = 0; i < XF_COMPONENT_ID_MAX; i++) - { - /* ...symbolic search - not too good; would prefer GUIDs in some form */ - if (!strncmp(id, xf_component_id[i].id, length)) - { - /* ...pass control to specific class factory */ - return xf_component_id[i].factory(core, xf_component_id[i].process); - } - } - - /* ...component string id is not recognized */ - TRACE(ERROR, _b("Unknown component type: %s"), id); - - return NULL; -} diff --git a/hifi/xaf/hifi-dpf/audio/xa-class-audio-codec.c b/hifi/xaf/hifi-dpf/audio/xa-class-audio-codec.c deleted file mode 100644 index 3806548f..00000000 --- a/hifi/xaf/hifi-dpf/audio/xa-class-audio-codec.c +++ /dev/null @@ -1,785 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-class-audio-codec.c - * - * Generic audio codec task implementation - * - ******************************************************************************/ - -#define MODULE_TAG CODEC - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#include "xa-class-base.h" -#include "audio/xa-audio-decoder-api.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(WARNING, 1); -TRACE_TAG(INFO, 1); -TRACE_TAG(INPUT, 1); -TRACE_TAG(OUTPUT, 1); -TRACE_TAG(DECODE, 1); - -/******************************************************************************* - * Internal functions definitions - ******************************************************************************/ - -typedef struct XAAudioCodec -{ - /*************************************************************************** - * Control data - **************************************************************************/ - - /* ...generic audio codec data */ - XACodecBase base; - - /* ...input port data */ - xf_input_port_t input; - - /* ...output port data */ - xf_output_port_t output; - - /* ...input port index */ - WORD32 in_idx; - - /* ...output port index */ - WORD32 out_idx; - - /*************************************************************************** - * Run-time configuration parameters - **************************************************************************/ - - /* ...sample size in bytes */ - u32 sample_size; - - /* ...audio sample duration */ - u32 factor; - - /* ...total number of produced audio frames since last reset */ - u32 produced; - -} XAAudioCodec; - -/******************************************************************************* - * Auxiliary codec execution flags - ******************************************************************************/ - -/* ...input port setup condition */ -#define XA_CODEC_FLAG_INPUT_SETUP __XA_BASE_FLAG(1 << 0) - -/* ...output port setup condition */ -#define XA_CODEC_FLAG_OUTPUT_SETUP __XA_BASE_FLAG(1 << 1) - -/******************************************************************************* - * Data processing scheduling - ******************************************************************************/ - -/* ...prepare codec for steady operation (tbd - don't absolutely like it) */ -static inline XA_ERRORCODE xa_codec_prepare_runtime(XAAudioCodec *codec) -{ - XACodecBase *base = (XACodecBase *)codec; - xf_message_t *m = xf_msg_queue_head(&codec->output.queue); - xf_start_msg_t *msg = m->buffer; - u32 frame_size; - u32 factor; - - /* ...fill-in buffer parameters */ - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_CODEC_CONFIG_PARAM_SAMPLE_RATE, &msg->sample_rate); - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_CODEC_CONFIG_PARAM_CHANNELS, &msg->channels); - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_CODEC_CONFIG_PARAM_PCM_WIDTH, &msg->pcm_width); - XA_API(base, XA_API_CMD_GET_MEM_INFO_SIZE, codec->in_idx, &msg->input_length); - XA_API(base, XA_API_CMD_GET_MEM_INFO_SIZE, codec->out_idx, &msg->output_length); - - TRACE(INIT, _b("codec[%p]::runtime init: f=%u, c=%u, w=%u, i=%u, o=%u"), codec, msg->sample_rate, msg->channels, msg->pcm_width, msg->input_length, msg->output_length); - - /* ...reallocate input port buffer as needed - tbd */ - BUG(msg->input_length > codec->input.length, _x("Input buffer reallocation required: %u to %u"), codec->input.length, msg->input_length); - - /* ...save sample size in bytes */ - codec->sample_size = msg->channels * (msg->pcm_width == 16 ? 2 : 4); - - /* ...calculate frame duration; get number of samples in the frame (don't like division here - tbd) */ - frame_size = msg->output_length / codec->sample_size; - - /* ...it must be a multiple */ - XF_CHK_ERR(frame_size * codec->sample_size == msg->output_length, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...retrieve upsampling factor for given sample rate */ - XF_CHK_ERR(factor = xf_timebase_factor(msg->sample_rate), XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...set frame duration factor (converts number of bytes into timebase units) */ - codec->factor = factor / codec->sample_size; - - TRACE(INIT, _b("ts-factor: %u (%u)"), codec->factor, factor); - - BUG(codec->factor * codec->sample_size != factor, _x("Freq mismatch: %u vs %u"), codec->factor * codec->sample_size, factor); - - /* ...pass response to caller (push out of output port) */ - xf_output_port_produce(&codec->output, sizeof(*msg)); - - /* ...codec runtime initialization is completed */ - TRACE(INIT, _b("codec[%p] runtime initialized: i=%u, o=%u"), codec, msg->input_length, msg->output_length); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Commands processing - ******************************************************************************/ - -/* ...EMPTY-THIS-BUFFER command processing */ -static XA_ERRORCODE xa_codec_empty_this_buffer(XACodecBase *base, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - /* ...make sure the port is sane */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == 0, XA_API_FATAL_INVALID_CMD); - - /* ...command is allowed only in post-init state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...put message into input queue */ - if (xf_input_port_put(&codec->input, m)) - { - /* ...restart stream if it is in completed state */ - if (base->state & XA_BASE_FLAG_COMPLETED) - { - /* ...reset execution stage */ - base->state = XA_BASE_FLAG_POSTINIT | XA_BASE_FLAG_EXECUTION; - - /* ...reset execution runtime */ - XA_API(base, XA_API_CMD_EXECUTE, XA_CMD_TYPE_DO_RUNTIME_INIT, NULL); - - /* ...reset produced samples counter */ - codec->produced = 0; - } - - /* ...codec must be in one of these states */ - XF_CHK_ERR(base->state & (XA_BASE_FLAG_RUNTIME_INIT | XA_BASE_FLAG_EXECUTION), XA_API_FATAL_INVALID_CMD); - - /* ...schedule data processing if output is ready */ - if (xf_output_port_ready(&codec->output)) - { - xa_base_schedule(base, 0); - } - } - - TRACE(INPUT, _b("Received buffer [%p]:%u"), m->buffer, m->length); - - return XA_NO_ERROR; -} - -/* ...FILL-THIS-BUFFER command processing */ -static XA_ERRORCODE xa_codec_fill_this_buffer(XACodecBase *base, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - /* ...make sure the port is sane */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == 1, XA_API_FATAL_INVALID_CMD); - - /* ...command is allowed only in postinit state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...special handling of zero-length buffer */ - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...message must be zero-length */ - BUG(m->length != 0, _x("Invalid message length: %u"), m->length); - } - else if (m == xf_output_port_control_msg(&codec->output)) - { - /* ...end-of-stream processing indication received; check the state */ - BUG((base->state & XA_BASE_FLAG_COMPLETED) == 0, _x("invalid state: %x"), base->state); - - /* ... mark flushing sequence is done */ - xf_output_port_flush_done(&codec->output); - - /* ...complete pending zero-length input buffer */ - xf_input_port_purge(&codec->input); - - TRACE(INFO, _b("codec[%p] playback completed"), codec); - - /* ...playback is over */ - return XA_NO_ERROR; - } - else if ((base->state & XA_BASE_FLAG_COMPLETED) && !xf_output_port_routed(&codec->output)) - { - /* ...return message arrived from application immediately */ - xf_response_ok(m); - - return XA_NO_ERROR; - } - else - { - TRACE(OUTPUT, _b("Received output buffer [%p]:%u"), m->buffer, m->length); - - /* ...adjust message length (may be shorter than original) */ - m->length = codec->output.length; - } - - /* ...place message into output port */ - if (xf_output_port_put(&codec->output, m) && xf_input_port_ready(&codec->input)) - { - /* ...schedule data processing instantly */ - if (base->state & (XA_BASE_FLAG_RUNTIME_INIT | XA_BASE_FLAG_EXECUTION)) - { - xa_base_schedule(base, 0); - } - } - - return XA_NO_ERROR; -} - -/* ...output port routing */ -static XA_ERRORCODE xa_codec_port_route(XACodecBase *base, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - xf_route_port_msg_t *cmd = m->buffer; - xf_output_port_t *port = &codec->output; - u32 src = XF_MSG_DST(m->id); - u32 dst = cmd->dst; - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...make sure output port is addressed */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == 1, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...make sure port is not routed yet */ - XF_CHK_ERR(!xf_output_port_routed(port), XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...route output port - allocate queue */ - XF_CHK_ERR(xf_output_port_route(port, __XF_MSG_ID(dst, src), cmd->alloc_number, cmd->alloc_size, cmd->alloc_align) == 0, XA_API_FATAL_MEM_ALLOC); - - /* ...schedule processing instantly */ - xa_base_schedule(base, 0); - - /* ...pass success result to caller */ - xf_response_ok(m); - - return XA_NO_ERROR; -} - -/* ...port unroute command */ -static XA_ERRORCODE xa_codec_port_unroute(XACodecBase *base, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...make sure output port is addressed */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == 1, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...cancel any pending processing */ - xa_base_cancel(base); - - /* ...clear output-port-setup condition */ - base->state &= ~XA_CODEC_FLAG_OUTPUT_SETUP; - - /* ...pass flush command down the graph */ - if (xf_output_port_flush(&codec->output, XF_FLUSH)) - { - TRACE(INFO, _b("port is idle; instantly unroute")); - - /* ...flushing sequence is not needed; command may be satisfied instantly */ - xf_output_port_unroute(&codec->output); - - /* ...pass response to the proxy */ - xf_response_ok(m); - } - else - { - TRACE(INFO, _b("port is busy; propagate unroute command")); - - /* ...flushing sequence is started; save flow-control message */ - xf_output_port_unroute_start(&codec->output, m); - } - - return XA_NO_ERROR; -} - -/* ...FLUSH command processing */ -static XA_ERRORCODE xa_codec_flush(XACodecBase *base, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...ensure input parameter length is zero */ - XF_CHK_ERR(m->length == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - TRACE(1, _b("flush command received")); - - /* ...flush command must be addressed to input port */ - if (XF_MSG_DST_PORT(m->id) == 0) - { - /* ...cancel data processing message if needed */ - xa_base_cancel(base); - - /* ...input port flushing; purge content of input buffer */ - xf_input_port_purge(&codec->input); - - /* ...clear input-ready condition */ - base->state &= ~XA_CODEC_FLAG_INPUT_SETUP; - - /* ...reset execution runtime */ - XA_API(base, XA_API_CMD_EXECUTE, XA_CMD_TYPE_DO_RUNTIME_INIT, NULL); - - /* ...reset produced samples counter */ - codec->produced = 0; - - /* ...propagate flushing command to output port */ - if (xf_output_port_flush(&codec->output, XF_FLUSH)) - { - /* ...flushing sequence is not needed; satisfy command instantly */ - xf_response(m); - } - else - { - /* ...flushing sequence is started; save flow-control message at input port */ - xf_input_port_control_save(&codec->input, m); - } - } - else if (xf_output_port_unrouting(&codec->output)) - { - /* ...flushing during port unrouting; complete unroute sequence */ - xf_output_port_unroute_done(&codec->output); - - TRACE(INFO, _b("port is unrouted")); - } - else - { - /* ...output port flush command/response; check if the port is routed */ - if (!xf_output_port_routed(&codec->output)) - { - /* ...complete all queued messages */ - xf_output_port_flush(&codec->output, XF_FLUSH); - - /* ...and pass response to flushing command */ - xf_response(m); - } - else - { - /* ...response to flushing command received */ - BUG(m != xf_output_port_control_msg(&codec->output), _x("invalid message: %p"), m); - - /* ...mark flushing sequence is completed */ - xf_output_port_flush_done(&codec->output); - - /* ...complete original flow-control command */ - xf_input_port_purge_done(&codec->input); - } - - /* ...clear output-setup condition */ - base->state &= ~XA_CODEC_FLAG_OUTPUT_SETUP; - } - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Generic codec API - ******************************************************************************/ - -/* ...memory buffer handling */ -static XA_ERRORCODE xa_codec_memtab(XACodecBase *base, WORD32 idx, WORD32 type, WORD32 size, WORD32 align, u32 core) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - if (type == XA_MEMTYPE_INPUT) - { - /* ...input port specification; allocate internal buffer */ - XF_CHK_ERR(xf_input_port_init(&codec->input, size, align, core) == 0, XA_API_FATAL_MEM_ALLOC); - - /* ...save input port index */ - codec->in_idx = idx; - - /* ...set input buffer pointer as needed */ - (size ? XA_API(base, XA_API_CMD_SET_MEM_PTR, idx, codec->input.buffer) : 0); - - (size ? TRACE(1, _x("set input ptr: %p"), codec->input.buffer) : 0); - } - else - { - /* ...output buffer specification */ - XF_CHK_ERR(type == XA_MEMTYPE_OUTPUT, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...initialize output port queue (no allocation here yet) */ - XF_CHK_ERR(xf_output_port_init(&codec->output, size) == 0, XA_API_FATAL_MEM_ALLOC); - - /* ...save output port index */ - codec->out_idx = idx; - } - - return XA_NO_ERROR; -} - -/* ...prepare input/output buffers */ -static XA_ERRORCODE xa_codec_preprocess(XACodecBase *base) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - /* ...prepare output buffer if needed */ - if (!(base->state & XA_CODEC_FLAG_OUTPUT_SETUP)) - { - void *output; - - /* ...get output buffer from port, if possible */ - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...run-time is not initialized yet; use scratch buffer */ - output = base->scratch; - } - else if ((output = xf_output_port_data(&codec->output)) == NULL) - { - /* ...no output buffer available */ - return XA_CODEC_EXEC_NO_DATA; - } - - /* ...set the output buffer pointer */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, codec->out_idx, output); - - TRACE(1, _x("set output ptr: %p"), output); - - /* ...mark output port is setup */ - base->state ^= XA_CODEC_FLAG_OUTPUT_SETUP; - } - - /* ...prepare input data if needed */ - if (!(base->state & XA_CODEC_FLAG_INPUT_SETUP)) - { - void *input; - u32 filled; - - /* ...fill input buffer */ - if (xf_input_port_bypass(&codec->input)) - { - /* ...use input buffer directly; check if there is data available */ - if ((input = xf_input_port_data(&codec->input)) != NULL) - { - /* ...set input data buffer pointer */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, codec->in_idx, input); - - /* ...retrieve number of input bytes */ - filled = xf_input_port_length(&codec->input); - } - else if (!xf_input_port_done(&codec->input)) - { - /* ...return non-fatal indication to prevent further processing */ - return XA_CODEC_EXEC_NO_DATA; - } - else - { - /* ...mark we have no data in current buffer */ - filled = 0; - } - } - else - { - /* ...port is in non-bypass mode; try to fill internal buffer */ - if (xf_input_port_done(&codec->input) || xf_input_port_fill(&codec->input)) - { - /* ...retrieve number of bytes in input buffer (not really - tbd) */ - filled = xf_input_port_level(&codec->input); - } - else - { - /* ...return non-fatal indication to prevent further processing */ - return XA_CODEC_EXEC_NO_DATA; - } - } - - /* ...check if input stream is over */ - if (xf_input_port_done(&codec->input)) - { - /* ...pass input-over command to the codec to indicate the final buffer */ - XA_API(base, XA_API_CMD_INPUT_OVER, codec->in_idx, NULL); - - TRACE(INFO, _b("codec[%p]: signal input-over (filled: %u)"), codec, filled); - } - - TRACE(INPUT, _b("input-buffer fill-level: %u bytes"), filled); - - /* ...specify number of bytes available in the input buffer */ - XA_API(base, XA_API_CMD_SET_INPUT_BYTES, codec->in_idx, &filled); - - /* ...mark input port is setup */ - base->state ^= XA_CODEC_FLAG_INPUT_SETUP; - } - - return XA_NO_ERROR; -} - -/* ...post-processing operation; input/output ports maintenance */ -static XA_ERRORCODE xa_codec_postprocess(XACodecBase *base, int done) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - WORD32 consumed = 0; - WORD32 produced = 0; - - /* ...get number of consumed / produced bytes */ - XA_API(base, XA_API_CMD_GET_CURIDX_INPUT_BUF, codec->in_idx, &consumed); - - /* ...get number of produced bytes only if runtime is initialized (sample size is known) */ - (codec->sample_size ? XA_API(base, XA_API_CMD_GET_OUTPUT_BYTES, codec->out_idx, &produced) : 0); - - TRACE(DECODE, _b("codec[%p]::postprocess(c=%u, p=%u, d=%u)"), codec, consumed, produced, done); - - /* ...input buffer maintenance; check if we consumed anything */ - if (consumed) - { - /* ...consume specified number of bytes from input port */ - xf_input_port_consume(&codec->input, consumed); - - /* ...clear input-setup flag */ - base->state ^= XA_CODEC_FLAG_INPUT_SETUP; - } - - /* ...output buffer maintenance; check if we have produced anything */ - if (produced) - { - /* ...increment total number of produced samples (really don't like division here - tbd) */ - codec->produced += produced / codec->sample_size; - - /* ...immediately complete output buffer (don't wait until it gets filled) */ - xf_output_port_produce(&codec->output, produced); - - /* ...clear output port setup flag */ - base->state ^= XA_CODEC_FLAG_OUTPUT_SETUP; - } - - /* ...process execution stage transition */ - if (done) - { - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...stream is completed while codec is in runtime initialization stage */ - BUG(1, _x("breakpoint")); - } - else if (base->state & XA_BASE_FLAG_EXECUTION) - { - /* ...runtime initialization done */ - XA_CHK(xa_codec_prepare_runtime(codec)); - - /* ...clear output port setup flag as we were using scratch buffer; - * technically, no need to repeat setup of input buffer, but some codecs require - * it as well - */ - base->state &= ~(XA_CODEC_FLAG_INPUT_SETUP | XA_CODEC_FLAG_OUTPUT_SETUP); - } - else - { - /* ...output stream is over; propagate condition to sink port */ - if (xf_output_port_flush(&codec->output, XF_FILL_THIS_BUFFER)) - { - /* ...flushing sequence is not needed; complete pending zero-length input */ - xf_input_port_purge(&codec->input); - - /* ...no propagation to output port */ - TRACE(INFO, _b("codec[%p] playback completed"), codec); - } - else - { - /* ...flushing sequence is started; wait until flow-control message returns */ - TRACE(INFO, _b("propagate end-of-stream condition")); - } - } - - /* ...return early to prevent task rescheduling */ - return XA_NO_ERROR; - } - - /* ...reschedule processing if needed */ - if (xf_input_port_ready(&codec->input) && xf_output_port_ready(&codec->output)) - { - /* ...schedule data processing with respect to its urgency */ - xa_base_schedule(base, produced * codec->factor); - } - - return XA_NO_ERROR; -} - -/* ...configuration parameter retrieval */ -static XA_ERRORCODE xa_codec_getparam(XACodecBase *base, WORD32 id, pVOID value) -{ - XAAudioCodec *codec = (XAAudioCodec *) base; - - if (id == XA_CODEC_CONFIG_PARAM_PRODUCED) - { - /* ...retrieve number of produced samples since last reset */ - *(u32 *)value = codec->produced; - - return XA_NO_ERROR; - } - else - { - /* ...pass command to underlying codec plugin */ - return XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, id, value); - } -} - -/******************************************************************************* - * Component entry point - ******************************************************************************/ - -/* ...command hooks */ -static XA_ERRORCODE (* const xa_codec_cmd[])(XACodecBase *, xf_message_t *) = -{ - [XF_OPCODE_TYPE(XF_SET_PARAM)] = xa_base_set_param, - [XF_OPCODE_TYPE(XF_GET_PARAM)] = xa_base_get_param, - [XF_OPCODE_TYPE(XF_ROUTE)] = xa_codec_port_route, - [XF_OPCODE_TYPE(XF_UNROUTE)] = xa_codec_port_unroute, - [XF_OPCODE_TYPE(XF_EMPTY_THIS_BUFFER)] = xa_codec_empty_this_buffer, - [XF_OPCODE_TYPE(XF_FILL_THIS_BUFFER)] = xa_codec_fill_this_buffer, - [XF_OPCODE_TYPE(XF_FLUSH)] = xa_codec_flush, - [XF_OPCODE_TYPE(XF_SET_PARAM_EXT)] = xa_base_set_param_ext, - [XF_OPCODE_TYPE(XF_GET_PARAM_EXT)] = xa_base_get_param_ext, -}; - -/* ...total number of commands supported */ -#define XA_CODEC_CMD_NUM (sizeof(xa_codec_cmd) / sizeof(xa_codec_cmd[0])) - -/* ...command processor for termination state (only for routed port case) */ -static int xa_audio_codec_terminate(xf_component_t *component, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) component; - u32 opcode = m->opcode; - - /* ...check if we received output port control message */ - if (m == xf_output_port_control_msg(&codec->output)) - { - /* ...output port flushing complete; mark port is idle and terminate */ - xf_output_port_flush_done(&codec->output); - return -1; - } - else if (opcode == XF_FILL_THIS_BUFFER) - { - /* ...output buffer returned by the sink component; ignore and keep waiting */ - TRACE(OUTPUT, _b("collect output buffer")); - return 0; - } - else if (opcode == XF_UNREGISTER) - { - /* ...ignore subsequent unregister command/response - tbd */ - return 0; - } - else - { - /* ...everything else is responded with generic failure */ - xf_response_err(m); - return 0; - } -} - -/* ...audio codec destructor */ -static int xa_audio_codec_destroy(xf_component_t *component, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) component; - u32 core = xf_component_core(component); - - /* ...destroy input port */ - xf_input_port_destroy(&codec->input, core); - - /* ...destroy output port */ - xf_output_port_destroy(&codec->output, core); - - /* ...deallocate all resources */ - xa_base_destroy(&codec->base, XF_MM(sizeof(*codec)), core); - - TRACE(INIT, _b("audio-codec[%p@%u] destroyed"), codec, core); - - /* ...indicate the client has been destroyed */ - return 0; -} - -/* ...audio codec destructor - first stage (ports unrouting) */ -static int xa_audio_codec_cleanup(xf_component_t *component, xf_message_t *m) -{ - XAAudioCodec *codec = (XAAudioCodec *) component; - - /* ...complete message with error response */ - xf_response_err(m); - - /* ...cancel internal scheduling message if needed */ - xa_base_cancel(&codec->base); - - /* ...purge input port (returns OK? pretty strange at this point - tbd) */ - xf_input_port_purge(&codec->input); - - /* ...propagate unregister command to connected component */ - if (xf_output_port_flush(&codec->output, XF_FLUSH)) - { - /* ...flushing sequence is not needed; destroy audio codec */ - return xa_audio_codec_destroy(component, NULL); - } - else - { - /* ...wait until output port is cleaned; adjust component hooks */ - component->entry = xa_audio_codec_terminate; - component->exit = xa_audio_codec_destroy; - - TRACE(INIT, _b("codec[%p] cleanup sequence started"), codec); - - /* ...indicate that second stage is required */ - return 1; - } -} - -/******************************************************************************* - * Audio codec component factory - ******************************************************************************/ - -xf_component_t * xa_audio_codec_factory(u32 core, xa_codec_func_t process) -{ - XAAudioCodec *codec; - - /* ...allocate local memory for codec structure */ - XF_CHK_ERR(codec = (XAAudioCodec *) xa_base_factory(core, XF_MM(sizeof(*codec)), process), NULL); - - /* ...set base codec API methods */ - codec->base.memtab = xa_codec_memtab; - codec->base.preprocess = xa_codec_preprocess; - codec->base.postprocess = xa_codec_postprocess; - codec->base.getparam = xa_codec_getparam; - - /* ...set message commands processing table */ - codec->base.command = xa_codec_cmd; - codec->base.command_num = XA_CODEC_CMD_NUM; - - /* ...set component destructor hook */ - codec->base.component.exit = xa_audio_codec_cleanup; - - TRACE(INIT, _b("Codec[%p] initialized"), codec); - - return (xf_component_t *) codec; -} diff --git a/hifi/xaf/hifi-dpf/audio/xa-class-base.c b/hifi/xaf/hifi-dpf/audio/xa-class-base.c deleted file mode 100644 index 0b672553..00000000 --- a/hifi/xaf/hifi-dpf/audio/xa-class-base.c +++ /dev/null @@ -1,537 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-class-base.c - * - * Generic audio codec task implementation - * - ******************************************************************************/ - -#define MODULE_TAG BASE - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#include "xa-class-base.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(WARNING, 1); -TRACE_TAG(SETUP, 1); -TRACE_TAG(EXEC, 1); - -/******************************************************************************* - * Internal functions definitions - ******************************************************************************/ - -/* ...codec pre-initialization */ -static XA_ERRORCODE xa_base_preinit(XACodecBase *base, u32 core) -{ - WORD32 n; - - /* ...codec must be empty */ - XF_CHK_ERR(base->state == 0, XA_API_FATAL_INVALID_CMD); - - /* ...get API structure size */ - XA_API(base, XA_API_CMD_GET_API_SIZE, 0, &n); - - /* ...allocate memory for codec API structure (4-bytes aligned) */ - XMALLOC(&base->api, n, 4, core); - - /* ...set default config parameters */ - XA_API(base, XA_API_CMD_INIT, XA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS, NULL); - - /* ...get memory info tables size */ - if (XA_API(base, XA_API_CMD_GET_MEMTABS_SIZE, 0, &n), n != 0) - { - /* ...allocate memory for tables (4-bytes aligned) */ - XMALLOC(&base->mem_tabs, n, 4, core); - - /* ...set pointer for process memory tables */ - XA_API(base, XA_API_CMD_SET_MEMTABS_PTR, 0, base->mem_tabs.addr); - } - - TRACE(INIT, _b("Codec[%p] pre-initialization completed"), base); - - return XA_NO_ERROR; -} - -/* ...post-initialization setup */ -static XA_ERRORCODE xa_base_postinit(XACodecBase *base, u32 core) -{ - WORD32 n, i; - - /* ...issue post-config command and determine the buffer requirements */ - XA_API(base, XA_API_CMD_INIT, XA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS, NULL); - - /* ...get number of memory tables required */ - XA_API(base, XA_API_CMD_GET_N_MEMTABS, 0, &n); - - /* ...set scratch buffer in advance (as codec not necessarily exposes it) */ - base->scratch = XF_CORE_DATA(core)->scratch; - - /* ...allocate memory buffers */ - for (i = 0; i < n; i++) - { - WORD32 size, align, type; - - TRACE(1, _b("i = %u (of %u)"), (u32)i, (u32)n); - - /* ...get memory type */ - XA_API(base, XA_API_CMD_GET_MEM_INFO_TYPE, i, &type); - - /* ...get memory size of i-th buffer */ - XA_API(base, XA_API_CMD_GET_MEM_INFO_SIZE, i, &size); - - /* ...get alignment */ - XA_API(base, XA_API_CMD_GET_MEM_INFO_ALIGNMENT, i, &align); - - /* ...process individual buffer */ - switch (type) - { - case XA_MEMTYPE_SCRATCH: - /* ...scratch memory is shared among all codecs; check its validity */ - XF_CHK_ERR(size <= XF_CFG_CODEC_SCRATCHMEM_SIZE, XA_API_FATAL_MEM_ALLOC); - - /* ...make sure alignment is sane */ - XF_CHK_ERR((XF_CFG_CODEC_SCRATCHMEM_ALIGN & (align - 1)) == 0, XA_API_FATAL_MEM_ALIGN); - - /* ...set the scratch memory pointer */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, i, base->scratch); - - TRACE(INIT, _b("Mem tab %d: sz=%d al=%d ty=%d Scratch memory (%p)"), i, size, align, type, base->scratch); - - break; - - case XA_MEMTYPE_PERSIST: - /* ...allocate persistent memory */ - XMALLOC(&base->persist, size, align, core); - - /* ...and set the pointer instantly */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, i, base->persist.addr); - - TRACE(INIT, _b("Mem tab %d: sz=%d al=%d ty=%d Persistent memory (%p)"), i, size, align, type, base->persist.addr); - - break; - - case XA_MEMTYPE_INPUT: - case XA_MEMTYPE_OUTPUT: - /* ...input/output buffer specification; pass to codec function */ - CODEC_API(base, memtab, i, type, size, align, core); - - break; - - default: - /* ...unrecognized memory type */ - TRACE(ERROR, _x("Invalid memory type: [%d]=(%u, %u, %u)"), i, type, size, align); - return XA_API_FATAL_INVALID_CMD_TYPE; - } - } - - TRACE(INIT, _b("Codec[%p] post-initialization completed (api:%p[%u])"), base, base->api.addr, base->api.size); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Commands processing - ******************************************************************************/ - -/* ...SET-PARAM processing (enabled in all states) */ -XA_ERRORCODE xa_base_set_param(XACodecBase *base, xf_message_t *m) -{ - xf_set_param_msg_t *cmd = m->buffer; - xf_set_param_item_t *param = &cmd->item[0]; - WORD32 n, i; - - /* ...calculate total amount of parameters */ - n = m->length / sizeof(*param); - - /* ...check the message length is sane */ - XF_CHK_ERR(m->length == XF_SET_PARAM_CMD_LEN(n), XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...apply all parameters; pass to codec-specific function */ - for (i = 0; i < n; i++) - { - TRACE(SETUP, _b("set-param[%p]: [%u]=%u"), base, param[i].id, param[i].value); - - if (base->setparam) - { - CODEC_API(base, setparam, param[i].id, ¶m[i].value); - } - else - { - XA_API(base, XA_API_CMD_SET_CONFIG_PARAM, param[i].id, ¶m[i].value); - } - } - - /* ...check if we need to do post-initialization */ - if ((base->state & XA_BASE_FLAG_POSTINIT) == 0) - { - /* ...do post-initialization step */ - XA_CHK(xa_base_postinit(base, XF_MSG_DST_CORE(m->id))); - - /* ...mark the codec static configuration is set */ - base->state ^= XA_BASE_FLAG_POSTINIT | XA_BASE_FLAG_RUNTIME_INIT; - } - - /* ...complete message processing; output buffer is empty */ - xf_response_ok(m); - - return XA_NO_ERROR; -} - -/* ...GET-PARAM message processing (enabled in all states) */ -XA_ERRORCODE xa_base_get_param(XACodecBase *base, xf_message_t *m) -{ - xf_get_param_msg_t *cmd = m->buffer; - u32 *id = &cmd->c.id[0]; - u32 *value = &cmd->r.value[0]; - u32 n, i; - - /* ...calculate amount of parameters */ - n = m->length / sizeof(*id); - - /* ...check input parameter length */ - XF_CHK_ERR(XF_GET_PARAM_CMD_LEN(n) == m->length, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...retrieve the collection of codec parameters */ - for (i = 0; i < n; i++) - { - /* ...place the result into same location */ - if (base->getparam) - { - CODEC_API(base, getparam, id[i], &value[i]); - } - else - { - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, id[i], &value[i]); - } - } - - /* ...complete message specifying output buffer size */ - xf_response_data(m, XF_GET_PARAM_RSP_LEN(n)); - - return XA_NO_ERROR; -} - -/* ...SET-PARAM-EXT processing (enabled in all states) */ -XA_ERRORCODE xa_base_set_param_ext(XACodecBase *base, xf_message_t *m) -{ - xf_ext_param_msg_t *cmd = m->buffer; - u16 length = m->length; - u16 remaining = (length + 3) & ~3; - u16 i; - - for (i = 0; TRACE_CFG(SETUP) && i < remaining; i += 16) - { - TRACE(SETUP, _b("[%03x]: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X"), - i, - ((u8 *)m->buffer)[i + 0], ((u8 *)m->buffer)[i + 1], - ((u8 *)m->buffer)[i + 2], ((u8 *)m->buffer)[i + 3], - ((u8 *)m->buffer)[i + 4], ((u8 *)m->buffer)[i + 5], - ((u8 *)m->buffer)[i + 6], ((u8 *)m->buffer)[i + 7], - ((u8 *)m->buffer)[i + 8], ((u8 *)m->buffer)[i + 9], - ((u8 *)m->buffer)[i + 10], ((u8 *)m->buffer)[i + 11], - ((u8 *)m->buffer)[i + 12], ((u8 *)m->buffer)[i + 13], - ((u8 *)m->buffer)[i + 14], ((u8 *)m->buffer)[i + 15]); - } - - /* ...process all parameters encapsulated in buffer */ - while (remaining >= sizeof(*cmd)) - { - u16 id = cmd->desc.id; - u16 dlen = cmd->desc.length; - u16 dsize = (dlen + 3) & ~3; - u16 pad = dlen & 3; - - /* ...cut-off descriptor header */ - remaining -= sizeof(*cmd); - - TRACE(SETUP, _b("remaining:%u, desc_size:%u"), (u32)remaining, (u32)dsize); - - /* ...make sure length is sufficient */ - XF_CHK_ERR(remaining >= dsize, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...pad remaining bytes with zeroes */ - (pad ? memset(cmd->data + dlen, 0, 4 - pad) : 0); - - TRACE(SETUP, _b("set-ext-param[%p]: [%u]:%u - [%02X:%02X:%02X:%02X:...]"), base, id, dsize, cmd->data[0], cmd->data[1], cmd->data[2], cmd->data[3]); - - /* ...apply parameter */ - XA_API(base, XA_API_CMD_SET_CONFIG_PARAM, id, cmd->data); - - /* ...move to next item (keep 4-bytes alignment for descriptor) */ - cmd = (xf_ext_param_msg_t *)(&cmd->data[0] + dsize), remaining -= dsize; - } - - /* ...check the message is fully processed */ - XF_CHK_ERR(remaining == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...complete message processing; output buffer is empty */ - //xf_response_ok(m); - - /* ...unfortunately, it looks like a bug of the library that updates the memory - * and leaves it in a dirty state causing subsequent cache inconsistency - tbd - */ - xf_response_data(m, length); - - return XA_NO_ERROR; -} - -/* ...GET-PARAM-EXT message processing (enabled in all states) */ -XA_ERRORCODE xa_base_get_param_ext(XACodecBase *base, xf_message_t *m) -{ - xf_ext_param_msg_t *cmd = m->buffer; - u32 length = m->length; - u32 remaining = (length + 3) & ~3; - int i; - - for (i = 0; TRACE_CFG(SETUP) && i < remaining; i += 16) - { - TRACE(SETUP, _b("[%03x]: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X"), - i, - ((u8 *)m->buffer)[i + 0], ((u8 *)m->buffer)[i + 1], - ((u8 *)m->buffer)[i + 2], ((u8 *)m->buffer)[i + 3], - ((u8 *)m->buffer)[i + 4], ((u8 *)m->buffer)[i + 5], - ((u8 *)m->buffer)[i + 6], ((u8 *)m->buffer)[i + 7], - ((u8 *)m->buffer)[i + 8], ((u8 *)m->buffer)[i + 9], - ((u8 *)m->buffer)[i + 10], ((u8 *)m->buffer)[i + 11], - ((u8 *)m->buffer)[i + 12], ((u8 *)m->buffer)[i + 13], - ((u8 *)m->buffer)[i + 14], ((u8 *)m->buffer)[i + 15]); - } - - /* ...process all parameters encapsulated in buffer */ - while (remaining >= sizeof(*cmd)) - { - u16 id = cmd->desc.id; - u16 len = cmd->desc.length; - u16 size = (len + 3) & ~3; - u8 pad = len & 3; - - /* ...cut-off command header */ - remaining -= sizeof(*cmd); - - /* ...make sure data buffer has sufficient length */ - XF_CHK_ERR(remaining >= size, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...retrieve parameter from buffer (care about alignment? - tbd) */ - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, id, cmd->data); - - /* ...pad remaininig bytes with zeroes */ - (pad ? memset(cmd->data + len, 0, 4 - pad) : 0); - - TRACE(SETUP, _b("get-ext-param[%p]: [%u]:%u - [%02X:%02X:%02X:%02X:...]"), base, id, size, cmd->data[0], cmd->data[1], cmd->data[2], cmd->data[3]); - - /* ...move to next item (alignment issues? - tbd) */ - cmd = (xf_ext_param_msg_t *)(&cmd->data[0] + size), remaining -= size; - } - - /* ...check the message is fully processed */ - XF_CHK_ERR(remaining == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...complete message processing; output buffer has the same length */ - xf_response_data(m, length); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Command/data processing functions - ******************************************************************************/ - -/* ...generic codec data processing */ -static XA_ERRORCODE xa_base_process(XACodecBase *base) -{ - XA_ERRORCODE error; - WORD32 done; - - /* ...clear internal scheduling flag */ - base->state &= ~XA_BASE_FLAG_SCHEDULE; - - /* ...codec-specific preprocessing (buffer maintenance) */ - if ((error = CODEC_API(base, preprocess)) != XA_NO_ERROR) - { - /* ...return non-fatal codec error */ - return error; - } - - /* ...execution step */ - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...kick initialization process */ - XA_API(base, XA_API_CMD_INIT, XA_CMD_TYPE_INIT_PROCESS, NULL); - - /* ...check if initialization is completed */ - XA_API(base, XA_API_CMD_INIT, XA_CMD_TYPE_INIT_DONE_QUERY, &done); - - TRACE(EXEC, _b("Initialization result: %d"), done); - - /* ...switch to execution state if required */ - (done ? base->state ^= XA_BASE_FLAG_RUNTIME_INIT | XA_BASE_FLAG_EXECUTION : 0); - } - else if (base->state & XA_BASE_FLAG_EXECUTION) - { - TRACE(1, _b("do exec")); - - /* ...execute decoding process */ - XA_API(base, XA_API_CMD_EXECUTE, XA_CMD_TYPE_DO_EXECUTE, NULL); - - /* ...check for end-of-stream condition */ - XA_API(base, XA_API_CMD_EXECUTE, XA_CMD_TYPE_DONE_QUERY, &done); - - TRACE(EXEC, _b("Execution result: %d"), done); - - /* ...mark the output path is done to release all queued buffers */ - (done ? base->state ^= XA_BASE_FLAG_EXECUTION | XA_BASE_FLAG_COMPLETED : 0); - } - - /* ...codec-specific buffer post-processing */ - return CODEC_API(base, postprocess, done); -} - -/* ...message-processing function (component entry point) */ -static int xa_base_command(xf_component_t *component, xf_message_t *m) -{ - XACodecBase *base = (XACodecBase *) component; - u32 cmd; - - /* ...invoke data-processing function if message is null */ - if (m == NULL) - { - XF_CHK_ERR(!XA_ERROR_SEVERITY(xa_base_process(base)), -EPIPE); - return 0; - } - - /* ...process the command */ - TRACE(EXEC, _b("[%p]:state[%X]:(%X, %d, %p)"), base, base->state, m->opcode, m->length, m->buffer); - - /* ...bail out if this is forced termination command (I do have a map; maybe I'd better have a hook? - tbd) */ - if ((cmd = XF_OPCODE_TYPE(m->opcode)) == XF_OPCODE_TYPE(XF_UNREGISTER)) - { - TRACE(INIT, _b("force component[%p] termination"), base); - return -1; - } - - /* ...check opcode is valid */ - XF_CHK_ERR(cmd < base->command_num, -EINVAL); - - /* ...and has a hook */ - XF_CHK_ERR(base->command[cmd] != NULL, -EINVAL); - - /* ...pass control to specific command */ - XF_CHK_ERR(!XA_ERROR_SEVERITY(base->command[cmd](base, m)), -EPIPE); - - /* ...execution completed successfully */ - return 0; -} - -/******************************************************************************* - * Base codec API - ******************************************************************************/ - -/* ...data processing scheduling */ -void xa_base_schedule(XACodecBase *base, u32 dts) -{ - if ((base->state & XA_BASE_FLAG_SCHEDULE) == 0) - { - /* ...schedule component task execution */ - xf_component_schedule(&base->component, dts); - - /* ...and put scheduling flag */ - base->state ^= XA_BASE_FLAG_SCHEDULE; - } - else - { - TRACE(EXEC, _b("codec[%p] processing pending"), base); - } -} - -/* ...cancel data processing */ -void xa_base_cancel(XACodecBase *base) -{ - if (base->state & XA_BASE_FLAG_SCHEDULE) - { - /* ...cancel scheduled codec task */ - xf_component_cancel(&base->component); - - /* ...and clear scheduling flag */ - base->state ^= XA_BASE_FLAG_SCHEDULE; - - TRACE(EXEC, _b("codec[%p] processing cancelled"), base); - } -} - -/* ...base codec destructor */ -void xa_base_destroy(XACodecBase *base, u32 size, u32 core) -{ - /* ...deallocate all resources */ - xf_mm_free_buffer(&base->persist, core); - xf_mm_free_buffer(&base->mem_tabs, core); - xf_mm_free_buffer(&base->api, core); - - /* ...destroy codec structure (and task) itself */ - xf_mem_free(base, size, core, 0); - - TRACE(INIT, _b("codec[%p]:%u destroyed"), base, core); -} - -/* ...generic codec initialization routine */ -XACodecBase * xa_base_factory(u32 core, u32 size, xa_codec_func_t process) -{ - XACodecBase *base; - - /* ...make sure the size is sane */ - XF_CHK_ERR(size >= sizeof(XACodecBase), NULL); - - /* ...allocate local memory for codec structure */ - XF_CHK_ERR(base = xf_mem_alloc(size, 0, core, 0), NULL); - - /* ...reset codec memory */ - memset(base, 0, size); - - /* ...set low-level codec API function */ - base->process = process; - - /* ...set message processing function */ - base->component.entry = xa_base_command; - - /* ...do basic initialization */ - if (xa_base_preinit(base, core) != XA_NO_ERROR) - { - /* ...initialization failed for some reason; do cleanup */ - xa_base_destroy(base, size, core); - - return NULL; - } - - /* ...initialization completed successfully */ - TRACE(INIT, _b("Codec[%p]:%u initialized"), base, core); - - return base; -} diff --git a/hifi/xaf/hifi-dpf/audio/xa-class-base.h b/hifi/xaf/hifi-dpf/audio/xa-class-base.h deleted file mode 100644 index 252044d4..00000000 --- a/hifi/xaf/hifi-dpf/audio/xa-class-base.h +++ /dev/null @@ -1,263 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-class-base.h - * - * Generic Xtensa Audio codecs interfaces - * - ******************************************************************************/ - -#ifndef __XA_CLASS_BASE_H -#define __XA_CLASS_BASE_H - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...audio-specific API */ -#include "audio/xa_type_def.h" -#include "audio/xa_error_standards.h" -#include "audio/xa_apicmd_standards.h" -#include "audio/xa_memory_standards.h" - -/******************************************************************************* - * Generic codec structure - ******************************************************************************/ - -typedef struct XACodecBase XACodecBase; - -/* ...memory buffer initialization */ -typedef XA_ERRORCODE (*xa_codec_memtab_f)(XACodecBase *codec, WORD32 i, WORD32 type, WORD32 size, WORD32 align, u32 core); - -/* ...preprocessing operation */ -typedef XA_ERRORCODE (*xa_codec_preprocess_f)(XACodecBase *); - -/* ...postprocessing operation */ -typedef XA_ERRORCODE (*xa_codec_postprocess_f)(XACodecBase *, int); - -/* ...parameter setting function */ -typedef XA_ERRORCODE (*xa_codec_setparam_f)(XACodecBase *, WORD32, pVOID p); - -/* ...parameter retrival function */ -typedef XA_ERRORCODE (*xa_codec_getparam_f)(XACodecBase *, WORD32, pVOID p); - -/******************************************************************************* - * Codec instance structure - ******************************************************************************/ - -struct XACodecBase -{ - /*************************************************************************** - * Control data - **************************************************************************/ - - /* ...generic component handle */ - xf_component_t component; - - /* ...codec API entry point (function) */ - xa_codec_func_t *process; - - /* ...codec API handle, passed to *process */ - xf_mm_buffer_t api; - - /* ...memory table buffer */ - xf_mm_buffer_t mem_tabs; - - /* ...persistent memory buffer */ - xf_mm_buffer_t persist; - - /* ...scratch memory pointer */ - void *scratch; - - /* ...codec control state */ - u32 state; - - /*************************************************************************** - * Codec-specific methods - **************************************************************************/ - - /* ...memory buffer initialization */ - xa_codec_memtab_f memtab; - - /* ...preprocessing function */ - xa_codec_preprocess_f preprocess; - - /* ...postprocessing function */ - xa_codec_postprocess_f postprocess; - - /* ...configuration parameter setting function */ - xa_codec_setparam_f setparam; - - /* ...configuration parameter retrieval function */ - xa_codec_getparam_f getparam; - - /* ...command-processing table */ - XA_ERRORCODE (* const * command)(XACodecBase *, xf_message_t *); - - /* ...command-processing table size */ - u32 command_num; -}; - -/******************************************************************************* - * Base codec execution flags - ******************************************************************************/ - -/* ...codec static initialization completed */ -#define XA_BASE_FLAG_POSTINIT (1 << 0) - -/* ...codec runtime initialization sequence */ -#define XA_BASE_FLAG_RUNTIME_INIT (1 << 1) - -/* ...codec steady execution state */ -#define XA_BASE_FLAG_EXECUTION (1 << 2) - -/* ...execution stage completed */ -#define XA_BASE_FLAG_COMPLETED (1 << 3) - -/* ...data processing scheduling flag */ -#define XA_BASE_FLAG_SCHEDULE (1 << 4) - -/* ...base codec flags accessor */ -#define __XA_BASE_FLAGS(flags) ((flags) & ((1 << 5) - 1)) - -/* ...custom execution flag */ -#define __XA_BASE_FLAG(f) ((f) << 5) - -/******************************************************************************* - * Local macros definitions - ******************************************************************************/ - -/* ...audio-framework API function execution */ -#define XA_CHK(cond) \ -({ \ - XA_ERRORCODE __e = (cond); \ - if (__e != XA_NO_ERROR) \ - { \ - if (XA_ERROR_SEVERITY(__e)) \ - { \ - TRACE(ERROR, _x("error: %X"), __e); \ - return __e; \ - } \ - TRACE(WARNING, _x("warning: %X"), __e); \ - } \ - __e; \ -}) - -/* ...low-level codec API function execution */ -#define XA_API(codec, cmd, idx, pv) \ -({ \ - XA_ERRORCODE __e; \ - __e = (codec)->process((xa_codec_handle_t)(codec)->api.addr, (cmd), (idx), (pv)); \ - if (__e != XA_NO_ERROR) \ - { \ - if (XA_ERROR_SEVERITY(__e)) \ - { \ - TRACE(ERROR, _x("[%p]:(%d, %d, %p): %X"), (codec), (cmd), (idx), (pv), __e); \ - return __e; \ - } \ - TRACE(WARNING, _x("%X"), __e); \ - } \ - __e; \ -}) - -#define XA_API_NORET(codec, cmd, idx, pv) \ -({ \ - XA_ERRORCODE __e; \ - __e = (codec)->process((xa_codec_handle_t)(codec)->api.addr, (cmd), (idx), (pv)); \ - if (__e != XA_NO_ERROR) \ - { \ - if (XA_ERROR_SEVERITY(__e)) \ - { \ - TRACE(ERROR, _x("[%p]:(%d, %d, %p): %X"), (codec), (cmd), (idx), (pv), __e); \ - } \ - TRACE(WARNING, _x("%X"), __e); \ - } \ - __e; \ -}) - -/* ...codec hook invocation */ -#define CODEC_API(codec, func, ...) \ -({ \ - XA_ERRORCODE __e = (codec)->func((codec), ##__VA_ARGS__); \ - \ - if (__e != XA_NO_ERROR) \ - { \ - if (XA_ERROR_SEVERITY(__e)) \ - { \ - /* ...actual error is reported by the codec */ \ - TRACE(ERROR, _x("[%p]: " #func ": %X"), (codec), __e); \ - return __e; \ - } \ - \ - TRACE(WARNING, _x("warning: %X"), __e); \ - } \ - __e; \ -}) - -/* ...allocate local memory on specific core */ -#define XMALLOC(p, size, align, core) \ -do \ -{ \ - if (xf_mm_alloc_buffer((size), (align), (core), (p)) != 0) \ - { \ - TRACE(ERROR, _x("Failed to allocate %d bytes of memory"), (size)); \ - return XA_API_FATAL_MEM_ALLOC; \ - } \ - \ - if (((u32)((p)->addr) & ((align) - 1)) != 0) \ - { \ - TRACE(ERROR, _x("Invalid %d-algnment: %p"), (align), (p)->addr); \ - return XA_API_FATAL_MEM_ALIGN; \ - } \ -} \ -while (0) - -/******************************************************************************* - * Public API - ******************************************************************************/ - -/* ...SET-PARAM processing */ -extern XA_ERRORCODE xa_base_set_param(XACodecBase *base, xf_message_t *m); - -/* ...GET-PARAM-EXT message processing */ -extern XA_ERRORCODE xa_base_set_param_ext(XACodecBase *base, xf_message_t *m); - -/* ...GET-PARAM message processing */ -extern XA_ERRORCODE xa_base_get_param(XACodecBase *base, xf_message_t *m); - -/* ...GET-PARAM-EXT message processing */ -extern XA_ERRORCODE xa_base_get_param_ext(XACodecBase *base, xf_message_t *m); - -/* ...data processing scheduling */ -extern void xa_base_schedule(XACodecBase *base, u32 dts); - -/* ...cancel internal scheduling message */ -extern void xa_base_cancel(XACodecBase *base); - -/* ...base codec factory */ -extern XACodecBase * xa_base_factory(u32 core, u32 size, xa_codec_func_t process); - -/* ...base codec destructor */ -extern void xa_base_destroy(XACodecBase *base, u32 size, u32 core); - -#endif /* __XA_CLASS_BASE_H */ diff --git a/hifi/xaf/hifi-dpf/audio/xa-class-mixer.c b/hifi/xaf/hifi-dpf/audio/xa-class-mixer.c deleted file mode 100644 index ac2ff9ad..00000000 --- a/hifi/xaf/hifi-dpf/audio/xa-class-mixer.c +++ /dev/null @@ -1,870 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-class-mixer.c - * - * Generic mixer component class - * - ******************************************************************************/ - -#define MODULE_TAG MIXER - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#include "xa-class-base.h" -#include "audio/xa-mixer-api.h" - -/******************************************************************************* - * Tracing tags - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(WARNING, 1); -TRACE_TAG(INFO, 1); -TRACE_TAG(INPUT, 1); -TRACE_TAG(OUTPUT, 1); - -/******************************************************************************* - * Data structures - ******************************************************************************/ - -/* ...mixed source - input data */ -typedef struct XATrack -{ - /* ...input port data */ - xf_input_port_t input; - - /* ...current presentation timestamp (in samples; local to a mixer state) */ - u32 pts; - - /* ...total amount of decoded frames since last synchronization point */ - u32 decoded; - - /* ...total amount of rendered frames (consumed) since last synchronization point */ - u32 rendered; - -} XATrack; - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -static inline u32 xa_track_test_flags(XATrack *track, u32 flags) -{ - return (track->input.flags & flags); -} - -static inline u32 xa_track_set_flags(XATrack *track, u32 flags) -{ - return (track->input.flags |= flags); -} - -static inline u32 xa_track_clear_flags(XATrack *track, u32 flags) -{ - return (track->input.flags &= ~flags); -} - -static inline u32 xa_track_toggle_flags(XATrack *track, u32 flags) -{ - return (track->input.flags ^= flags); -} - -/******************************************************************************* - * Mixer data definitions - ******************************************************************************/ - -/* ...mixer data */ -typedef struct XAMixer -{ - /*************************************************************************** - * Control data - **************************************************************************/ - - /* ...generic audio codec data */ - XACodecBase base; - - /* ...input tracks */ - XATrack track[XA_MIXER_MAX_TRACK_NUMBER]; - - /* ...output port */ - xf_output_port_t output; - - /*************************************************************************** - * Run-time configuration parameters - **************************************************************************/ - - /* ...audio frame size in samples */ - u32 frame_size; - - /* ...audio frame duration */ - u32 frame_duration; - - /* ...presentation timestamp (in samples; local mixer scope) */ - u32 pts; - -} XAMixer; - -/******************************************************************************* - * Mixer flags - ******************************************************************************/ - -/* ...output port setup completed */ -#define XA_MIXER_FLAG_OUTPUT_SETUP __XA_BASE_FLAG(1 << 0) - -/******************************************************************************* - * Track state flags - ******************************************************************************/ - -/* ...track is idle (will autostart as soon as input data received) */ -#define XA_TRACK_FLAG_IDLE __XF_INPUT_FLAG(1 << 0) - -/* ...track is rendered */ -#define XA_TRACK_FLAG_ACTIVE __XF_INPUT_FLAG(1 << 1) - -/* ...track is paused */ -#define XA_TRACK_FLAG_PAUSED __XF_INPUT_FLAG(1 << 2) - -/* ...track input port is setup */ -#define XA_TRACK_FLAG_INPUT_SETUP __XF_INPUT_FLAG(1 << 3) - -/* ...track has received data */ -#define XA_TRACK_FLAG_RECVD_DATA __XF_INPUT_FLAG(1 << 4) - -/******************************************************************************* - * Helper functions - ******************************************************************************/ -/* ...Count the tracks that have received data or are active*/ -static inline UWORD32 xa_mixer_check_active(XAMixer *mixer) -{ - XATrack *track; - UWORD32 i; - UWORD32 cnt = 0; - - for (track = &mixer->track[i = 0]; i < XA_MIXER_MAX_TRACK_NUMBER; i++, track++) - { - if (xa_track_test_flags(track, XA_TRACK_FLAG_RECVD_DATA | XA_TRACK_FLAG_ACTIVE)) - cnt++; - } - return cnt; -} - -/* ...prepare mixer for steady operation */ -static inline XA_ERRORCODE xa_mixer_prepare_runtime(XAMixer *mixer) -{ - XACodecBase *base = (XACodecBase *) mixer; - xf_message_t *m = xf_msg_dequeue(&mixer->output.queue); - xf_start_msg_t *msg = m->buffer; - u32 frame_size; - u32 factor; - - /* ...query mixer parameters */ - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_MIXER_CONFIG_PARAM_SAMPLE_RATE, &msg->sample_rate); - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_MIXER_CONFIG_PARAM_CHANNELS, &msg->channels); - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_MIXER_CONFIG_PARAM_PCM_WIDTH, &msg->pcm_width); - XA_API(base, XA_API_CMD_GET_MEM_INFO_SIZE, 0, &msg->input_length); - XA_API(base, XA_API_CMD_GET_MEM_INFO_SIZE, XA_MIXER_MAX_TRACK_NUMBER, &msg->output_length); - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_MIXER_CONFIG_PARAM_FRAME_SIZE, &frame_size); - - /* ...calculate mixer frame duration; get upsample factor */ - XF_CHK_ERR(factor = xf_timebase_factor(msg->sample_rate), XA_MIXER_CONFIG_FATAL_RANGE); - - /* ...set mixer frame duration */ - mixer->frame_duration = frame_size * factor; - - /* ...pass response to caller */ - xf_response_data(m, sizeof(*msg)); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Commands handlers - ******************************************************************************/ - -/* ...EMPTY-THIS-BUFFER command processing */ -static XA_ERRORCODE xa_mixer_empty_this_buffer(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - u32 i = XF_MSG_DST_PORT(m->id); - XATrack *track = &mixer->track[i]; - - /* ...make sure the port is valid */ - XF_CHK_ERR(i < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - TRACE(INPUT, _b("track-%u: received buffer [%p]:%u"), i, m->buffer, m->length); - - /* ...update received data for the track */ - if (m->length) - xa_track_set_flags(track, XA_TRACK_FLAG_RECVD_DATA); - else - xa_track_clear_flags(track, XA_TRACK_FLAG_RECVD_DATA); - - /* ...place received message into track input port */ - if (xf_input_port_put(&track->input, m)) - { - /* ...process track autostart if needed */ - if (xa_track_test_flags(track, XA_TRACK_FLAG_IDLE)) - { - /* ...put track into active state */ - xa_track_toggle_flags(track, XA_TRACK_FLAG_IDLE | XA_TRACK_FLAG_ACTIVE); - - /* ...save track presentation timestamp */ - track->pts = mixer->pts; - - TRACE(INFO, _b("track-%u started (pts=%x)"), i, track->pts); - } - - /* ...schedule data processing if there is output port available */ - if (xf_output_port_ready(&mixer->output)) - { - /* ...force data processing */ - xa_base_schedule(base, 0); - } - } - - return XA_NO_ERROR; -} - -/* ...FILL-THIS-BUFFER command processing */ -static XA_ERRORCODE xa_mixer_fill_this_buffer(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - u32 i = XF_MSG_DST_PORT(m->id); - - /* ...make sure the port is valid */ - XF_CHK_ERR(i == XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...process runtime initialization explicitly */ - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...message must be zero-length */ - XF_CHK_ERR(m->length == 0, XA_MIXER_EXEC_FATAL_STATE); - } - else if (m->length != 0) /* ...EOS response */ - { - /* ...message must have exactly expected size (there is no ordered abortion) */ - XF_CHK_ERR(m->length == mixer->output.length, XA_MIXER_EXEC_FATAL_STATE); - } - - TRACE(OUTPUT, _b("received output buffer [%p]:%u"), m->buffer, m->length); - - /* ...put message into output port */ - if (xf_output_port_put(&mixer->output, m)) - { - /* ...force data processing */ - xa_base_schedule(base, 0); - } - - return XA_NO_ERROR; -} - -/* ...output port routing */ -static XA_ERRORCODE xa_mixer_port_route(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - xf_route_port_msg_t *cmd = m->buffer; - xf_output_port_t *port = &mixer->output; - u32 src = XF_MSG_DST(m->id); - u32 dst = cmd->dst; - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...make sure output port is addressed */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...make sure port is not routed yet */ - XF_CHK_ERR(!xf_output_port_routed(port), XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...route output port - allocate queue */ - XF_CHK_ERR(xf_output_port_route(port, __XF_MSG_ID(dst, src), cmd->alloc_number, cmd->alloc_size, cmd->alloc_align) == 0, XA_API_FATAL_MEM_ALLOC); - - /* ...schedule processing instantly - tbd - check if we have anything pending on input */ - xa_base_schedule(base, 0); - - /* ...pass success result to caller */ - xf_response_ok(m); - - return XA_NO_ERROR; -} - -/* ...port unroute command */ -static XA_ERRORCODE xa_mixer_port_unroute(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - xf_output_port_t *port = &mixer->output; - - /* ...command is allowed only in "postinit" state */ - XF_CHK_ERR(base->state & XA_BASE_FLAG_POSTINIT, XA_API_FATAL_INVALID_CMD); - - /* ...make sure output port is addressed */ - XF_CHK_ERR(XF_MSG_DST_PORT(m->id) == XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...cancel any pending processing */ - xa_base_cancel(base); - - /* ...clear output-port-setup condition */ - base->state &= ~XA_MIXER_FLAG_OUTPUT_SETUP; - - /* ...pass flush command down the graph */ - if (xf_output_port_flush(port, XF_FLUSH)) - { - TRACE(INFO, _b("port is idle; instantly unroute")); - - /* ...flushing sequence is not needed; command may be satisfied instantly */ - xf_output_port_unroute(port); - - /* ...pass response to the proxy */ - xf_response_ok(m); - } - else - { - TRACE(INFO, _b("port is busy; propagate unroute command")); - - /* ...flushing sequence is started; save flow-control message */ - xf_output_port_unroute_start(port, m); - } - - return XA_NO_ERROR; -} - -/* ...PAUSE message processing */ -static XA_ERRORCODE xa_mixer_pause(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - u32 i = XF_MSG_DST_PORT(m->id); - XATrack *track = &mixer->track[i]; - - /* ...make sure the buffer is empty */ - XF_CHK_ERR(m->length == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check destination port is valid */ - XF_CHK_ERR(i < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check for actual track flags */ - if (xa_track_test_flags(track, XA_TRACK_FLAG_ACTIVE)) - { - /* ...switch to paused state */ - xa_track_toggle_flags(track, XA_TRACK_FLAG_ACTIVE | XA_TRACK_FLAG_PAUSED); - - /* ...other tracks may be waiting for this one, so force data processing */ - if (xf_output_port_ready(&mixer->output)) - { - xa_base_schedule(base, 0); - } - - TRACE(INFO, _b("mixer[%p]::track[%u] paused"), mixer, i); - } - else - { - /* ...track is in idle state and pausing here means suspending */ - TRACE(INFO, _b("mixer[%p]::track[%u] is not active"), mixer, i); - } - - /* ...complete message immediately */ - xf_response(m); - - return XA_NO_ERROR; -} - -/* ...RESUME command processing */ -static XA_ERRORCODE xa_mixer_resume(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - u32 i = XF_MSG_DST_PORT(m->id); - XATrack *track = &mixer->track[i]; - - /* ...make sure the buffer is empty */ - XF_CHK_ERR(m->length == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check destination port is valid */ - XF_CHK_ERR(i < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check for actual track state */ - if (xa_track_test_flags(track, XA_TRACK_FLAG_PAUSED)) - { - /* ...switch track to active state */ - xa_track_toggle_flags(track, XA_TRACK_FLAG_ACTIVE | XA_TRACK_FLAG_PAUSED); - - /* ...reset track presentation timestamp - tbd */ - track->pts = mixer->pts; - - /* ...force data processing if there is an output buffer */ - if (xf_output_port_ready(&mixer->output)) - { - xa_base_schedule(base, 0); - } - - TRACE(INFO, _b("mixer[%p]::track[%u] resumed"), mixer, i); - } - else - { - /* ...track is in idle state; do nothing */ - TRACE(INFO, _b("mixer[%p]::track[%u] is not paused"), mixer, i); - } - - /* ...complete message */ - xf_response(m); - - return XA_NO_ERROR; -} - -/* ...FLUSH command processing */ -static XA_ERRORCODE xa_mixer_flush(XACodecBase *base, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) base; - u32 i = XF_MSG_DST_PORT(m->id); - XATrack *track = &mixer->track[i]; - - /* ...make sure the buffer is empty */ - XF_CHK_ERR(m->length == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check destination port index */ - if (i == XA_MIXER_MAX_TRACK_NUMBER) - { - /* ...flushing response received; that is a port unrouting sequence */ - XF_CHK_ERR(xf_output_port_unrouting(&mixer->output), XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...complete unroute sequence */ - xf_output_port_unroute_done(&mixer->output); - - TRACE(INFO, _b("port is unrouted")); - - return XA_NO_ERROR; - } - - /* ...check destination port index is valid */ - XF_CHK_ERR(i < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...input port flushing; check the track state is valid */ - if (xa_track_test_flags(track, XA_TRACK_FLAG_ACTIVE | XA_TRACK_FLAG_PAUSED)) - { - /* ...purge input port */ - xf_input_port_purge(&track->input); - - /* ...force clearing of ACTIVE and INPUT_SETUP condition */ - xa_track_clear_flags(track, XA_TRACK_FLAG_ACTIVE | XA_TRACK_FLAG_PAUSED | XA_TRACK_FLAG_INPUT_SETUP); - - /* ...and enter into idle state */ - xa_track_set_flags(track, XA_TRACK_FLAG_IDLE); - - /* ...other tracks may be waiting for this track, so force data processing */ - if (xf_output_port_ready(&mixer->output)) - { - xa_base_schedule(base, 0); - } - - TRACE(INFO, _b("mixer[%p]::track[%u] flushed"), mixer, i); - } - - /* ...complete message instantly (no propagation to output port) */ - xf_response(m); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Codec API implementation - ******************************************************************************/ - -/* ...buffers handling */ -static XA_ERRORCODE xa_mixer_memtab(XACodecBase *base, WORD32 idx, WORD32 type, WORD32 size, WORD32 align, u32 core) -{ - XAMixer *mixer = (XAMixer *)base; - - if (type == XA_MEMTYPE_INPUT) - { - XATrack *track = &mixer->track[idx]; - - /* ...input buffer allocation; check track number is sane */ - XF_CHK_ERR(idx < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...create input port for a track */ - XF_CHK_ERR(xf_input_port_init(&track->input, size, align, core) == 0, XA_API_FATAL_MEM_ALLOC); - - /* ...set input port buffer */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, idx, track->input.buffer); - - /* ...put track into idle state (will start as soon as we receive data) */ - xa_track_set_flags(track, XA_TRACK_FLAG_IDLE); - - TRACE(INIT, _b("mixer[%p]::track[%u] input port created - size=%u"), mixer, idx, size); - } - else - { - /* ...output buffer allocation */ - XF_CHK_ERR(type == XA_MEMTYPE_OUTPUT, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check port number is what we expect */ - XF_CHK_ERR(idx == XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...set mixer frame-size (in samples - for timestamp tracking) */ - XA_API(base, XA_API_CMD_GET_CONFIG_PARAM, XA_MIXER_CONFIG_PARAM_FRAME_SIZE, &mixer->frame_size); - - /* ...create output port for a track */ - XF_CHK_ERR(xf_output_port_init(&mixer->output, size) == 0, XA_API_FATAL_MEM_ALLOC); - - TRACE(INIT, _b("mixer[%p] output port created; size=%u"), mixer, size); - } - - return XA_NO_ERROR; -} - -/* ...preprocessing function */ -static XA_ERRORCODE xa_mixer_preprocess(XACodecBase *base) -{ - XAMixer *mixer = (XAMixer *) base; - XATrack *track; - u8 i; - XA_ERRORCODE e = XA_MIXER_EXEC_NONFATAL_NO_DATA; - - /* ...prepare output buffer */ - if (!(base->state & XA_MIXER_FLAG_OUTPUT_SETUP)) - { - void *output; - - /* ...set output buffer pointer */ - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...no actual data processing during initialization */ - return XA_NO_ERROR; - } - else if ((output = xf_output_port_data(&mixer->output)) == NULL) - { - /* ...no output buffer available */ - return e; - } - - /* ...set output buffer pointer */ - XA_API(base, XA_API_CMD_SET_MEM_PTR, XA_MIXER_MAX_TRACK_NUMBER, output); - - /* ...mark output port is setup */ - base->state ^= XA_MIXER_FLAG_OUTPUT_SETUP; - } - - /* ...check EOS */ - if (!xa_mixer_check_active(mixer)) - { - /* ...push EOS to output port */ - xf_output_port_produce(&mixer->output, 0); - TRACE(INFO, _b("mixer[%p]::EOS generated"), mixer); - } - - /* ...setup input buffer pointers and length */ - for (track = &mixer->track[i = 0]; i < XA_MIXER_MAX_TRACK_NUMBER; i++, track++) - { - /* ...skip tracks that are not played */ - if (!xa_track_test_flags(track, XA_TRACK_FLAG_ACTIVE)) continue; - - /* ...set temporary mixing request */ - e = XA_NO_ERROR; - - /* ...skip the tracks that has been setup already */ - if (xa_track_test_flags(track, XA_TRACK_FLAG_INPUT_SETUP)) continue; - - /* ...found active track that hasn't been setup yet */ - TRACE(INPUT, _b("track-%u: ts=%x vs mts=%x"), i, track->pts, mixer->pts); - - /* ...if track presentation timestamp is in the future, do nothing yet really */ - if (!xf_time_after(track->pts, mixer->pts)) - { - u32 filled; - - /* ...take actual data from input port (mixer is always using internal buffer) */ - if (!xf_input_port_fill(&track->input)) - { - /* ...failed to prefill input buffer - no sufficient data yet */ - return XA_MIXER_EXEC_NONFATAL_NO_DATA; - } - else - { - /* ...retrieve number of bytes available */ - filled = xf_input_port_level(&track->input); - } - - /* ...set total number of bytes we have in buffer */ - XA_API(base, XA_API_CMD_SET_INPUT_BYTES, i, &filled); - - /* ...actual data is to be played */ - TRACE(INPUT, _b("track-%u: filled %u bytes"), i, filled); - } - - /* ...mark the track input is setup (emit silence or actual data) */ - xa_track_set_flags(track, XA_TRACK_FLAG_INPUT_SETUP); - } - - /* ...do mixing operation only when all active tracks are setup */ - return e; -} - -/* ...postprocessing function */ -static XA_ERRORCODE xa_mixer_postprocess(XACodecBase *base, int done) -{ - XAMixer *mixer = (XAMixer *) base; - XATrack *track; - u32 produced; - u32 consumed; - u8 i; - - /* ...process execution stage transitions */ - if (done) - { - if (base->state & XA_BASE_FLAG_RUNTIME_INIT) - { - /* ...failed to initialize runtime (can't be? - tbd)*/ - BUG(1, _x("breakpoint")); - } - else if (base->state & XA_BASE_FLAG_EXECUTION) - { - /* ...enter into execution state; initialize runtime */ - return XA_CHK(xa_mixer_prepare_runtime(mixer)); - } - else - { - /* ...mixer operation is over (can't be? - tbd) */ - BUG(1, _x("breakpoint")); - } - } - - /* ...input ports maintenance; process all tracks */ - for (track = &mixer->track[i = 0]; i < XA_MIXER_MAX_TRACK_NUMBER; i++, track++) - { - /* ...skip the tracks that are not runing */ - if (!xa_track_test_flags(track, XA_TRACK_FLAG_ACTIVE)) continue; - - /* ...clear input setup flag */ - xa_track_clear_flags(track, XA_TRACK_FLAG_INPUT_SETUP); - - /* ...advance track presentation timestamp */ - track->pts += mixer->frame_size; - - /* ...get total amount of consumed bytes */ - XA_API(base, XA_API_CMD_GET_CURIDX_INPUT_BUF, i, &consumed); - - TRACE(INPUT, _b("track-%u::postprocess(c=%u, ts=%x)"), i, consumed, track->pts); - - /* ...consume that amount from input port (may be zero) */ - xf_input_port_consume(&track->input, consumed); - - /* ...check if input port is done */ - if (xf_input_port_done(&track->input)) - { - /* ...input stream is over; return zero-length input back to caller */ - xf_input_port_purge(&track->input); - - /* ...switch to idle state */ - xa_track_toggle_flags(track, XA_TRACK_FLAG_ACTIVE | XA_TRACK_FLAG_IDLE); - - TRACE(INFO, _b("mixer[%p]::track[%u] completed"), mixer, i); - } - } - - /* ...check if we have produced anything */ - XA_API(base, XA_API_CMD_GET_OUTPUT_BYTES, XA_MIXER_MAX_TRACK_NUMBER, &produced); - - TRACE(OUTPUT, _b("mixer[%p]::postprocess(p=%u, ts=%x, done=%u)"), mixer, produced, mixer->pts, done); - - /* ...output port maintenance */ - if (produced) - { - /* ...make sure we have produced exactly single frame */ - BUG(produced != mixer->output.length, _x("Invalid length: %u != %u"), produced, mixer->output.length); - - /* ...steady mixing process; advance mixer presentation timestamp */ - mixer->pts += mixer->frame_size; - - /* ...push data from output port */ - xf_output_port_produce(&mixer->output, produced); - - /* ...clear output-setup condition */ - base->state &= ~XA_MIXER_FLAG_OUTPUT_SETUP; - } - - /* ...reschedule data processing if there is a pending output message */ - if (xf_output_port_ready(&mixer->output)) - { - /* ...schedule execution with respect to urgency */ - xa_base_schedule(base, (produced ? mixer->frame_duration : 0)); - } - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Command-processing function - ******************************************************************************/ - -/* ...command hooks */ -static XA_ERRORCODE (* const xa_mixer_cmd[])(XACodecBase *, xf_message_t *) = -{ - /* ...set-parameter - actually, same as in generic case */ - [XF_OPCODE_TYPE(XF_SET_PARAM)] = xa_base_set_param, - [XF_OPCODE_TYPE(XF_GET_PARAM)] = xa_base_get_param, - - /* ...output port routing/unrouting */ - [XF_OPCODE_TYPE(XF_ROUTE)] = xa_mixer_port_route, - [XF_OPCODE_TYPE(XF_UNROUTE)] = xa_mixer_port_unroute, - - /* ...input/output buffers processing */ - [XF_OPCODE_TYPE(XF_EMPTY_THIS_BUFFER)] = xa_mixer_empty_this_buffer, - [XF_OPCODE_TYPE(XF_FILL_THIS_BUFFER)] = xa_mixer_fill_this_buffer, - [XF_OPCODE_TYPE(XF_FLUSH)] = xa_mixer_flush, - - /* ...track control */ - [XF_OPCODE_TYPE(XF_PAUSE)] = xa_mixer_pause, - [XF_OPCODE_TYPE(XF_RESUME)] = xa_mixer_resume, -}; - -/* ...total number of commands supported */ -#define XA_MIXER_CMD_NUM (sizeof(xa_mixer_cmd) / sizeof(xa_mixer_cmd[0])) - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...mixer termination-state command processor */ -static int xa_mixer_terminate(xf_component_t *component, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) component; - u32 opcode = m->opcode; - - if (m == xf_output_port_control_msg(&mixer->output)) - { - /* ...output port flushing complete; mark port is idle and terminate */ - xf_output_port_flush_done(&mixer->output); - return -1; - } - else if (opcode == XF_FILL_THIS_BUFFER && xf_output_port_routed(&mixer->output)) - { - /* ...output buffer returned by the sink component; ignore and keep waiting */ - TRACE(OUTPUT, _b("collect output buffer")); - return 0; - } - else if (opcode == XF_UNREGISTER) - { - /* ...ignore subsequent unregister command/response */ - return 0; - } - else - { - /* ...everything else is responded with generic failure */ - xf_response_err(m); - return 0; - } -} - -/* ...mixer class destructor */ -static int xa_mixer_destroy(xf_component_t *component, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) component; - u32 core = xf_component_core(component); - u32 i; - - /* ...destroy all inputs */ - for (i = 0; i < XA_MIXER_MAX_TRACK_NUMBER; i++) - { - xf_input_port_destroy(&mixer->track[i].input, core); - } - - /* ...destroy output port */ - xf_output_port_destroy(&mixer->output, core); - - /* ...destroy base object */ - xa_base_destroy(&mixer->base, XF_MM(sizeof(*mixer)), core); - - TRACE(INIT, _b("mixer[%p] destroyed"), mixer); - - return 0; -} - -/* ...mixer class first-stage destructor */ -static int xa_mixer_cleanup(xf_component_t *component, xf_message_t *m) -{ - XAMixer *mixer = (XAMixer *) component; - u32 i; - - /* ...complete message with error result code */ - xf_response_err(m); - - /* ...cancel internal scheduling message if needed */ - xa_base_cancel(&mixer->base); - - /* ...purge all input ports (specify "unregister"? - don't know yet - tbd) */ - for (i = 0; i < XA_MIXER_MAX_TRACK_NUMBER; i++) - { - xf_input_port_purge(&mixer->track[i].input); - } - - /* ...flush output port */ - if (xf_output_port_flush(&mixer->output, XF_FLUSH)) - { - /* ...flushing sequence is not needed; destroy mixer */ - return xa_mixer_destroy(component, NULL); - } - else - { - /* ...wait until output port is cleaned; adjust component hooks */ - component->entry = xa_mixer_terminate; - component->exit = xa_mixer_destroy; - - TRACE(INIT, _b("mixer[%p] cleanup sequence started"), mixer); - - /* ...indicate that second stage is required */ - return 1; - } -} - -/* ...mixer class factory */ -xf_component_t * xa_mixer_factory(u32 core, xa_codec_func_t process) -{ - XAMixer *mixer; - - /* ...construct generic audio component */ - XF_CHK_ERR(mixer = (XAMixer *)xa_base_factory(core, XF_MM(sizeof(*mixer)), process), NULL); - - /* ...set generic codec API */ - mixer->base.memtab = xa_mixer_memtab; - mixer->base.preprocess = xa_mixer_preprocess; - mixer->base.postprocess = xa_mixer_postprocess; - - /* ...set message-processing table */ - mixer->base.command = xa_mixer_cmd; - mixer->base.command_num = XA_MIXER_CMD_NUM; - - /* ...set component destructor hook */ - mixer->base.component.exit = xa_mixer_cleanup; - - TRACE(INIT, _b("Mixer[%p] created"), mixer); - - /* ...return handle to component */ - return (xf_component_t *) mixer; -} diff --git a/hifi/xaf/hifi-dpf/build_hikey/Makefile b/hifi/xaf/hifi-dpf/build_hikey/Makefile deleted file mode 100644 index e1980a0d..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/Makefile +++ /dev/null @@ -1,135 +0,0 @@ -# -# Copyright (C) 2018 Cadence Design Systems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to use this Software with Cadence processor cores only and -# not with any other processors and platforms, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -.PHONY: all install clean HIKEY960 - -NOSTRIP = 1 -XF_TRACE = 1 - -ROOTDIR = .. -CODEC_NAME = hikey - -PLUGINO2OBJS = -PLUGINLIBS = -PLUGININCLUDES = - -XA_MP3_DECODER ?= 0 -XA_VORBIS_DECODER ?= 1 -XA_MIXER ?= 1 -XA_PCM ?= 1 - - -vpath %.c $(ROOTDIR)/ipc/xt-shmem/hikey -vpath %.c $(ROOTDIR)/ipc/xt-shmem -vpath %.c $(ROOTDIR)/core/util -vpath %.c $(ROOTDIR)/core/util/gdbstub -vpath %.c $(ROOTDIR)/core -vpath %.c $(ROOTDIR)/app -vpath %.c $(ROOTDIR)/audio - -vpath %.S $(ROOTDIR)/ipc/xt-shmem/hikey -vpath %.S $(ROOTDIR)/core/util/gdbstub - -vpath %.c $(ROOTDIR)/plugins/cadence/mixer - -LIBXAFASMOBJS = \ - reset.o \ - int_vector.o \ - arch_hifi330.o \ - gdbstub-entry.o - -LIBXAFO2OBJS = \ - cpu_c.o \ - dsp_debug.o \ - dsp_comm.o \ - mutex.o \ - rbtree.o \ - xf-core.o \ - xf-io.o \ - xf-mem.o \ - xf-msg.o \ - xf-sched.o \ - xa-factory.o \ - xf-shmem.o \ - tinyvprintf.o \ - xf-isr.o \ - gdbstub.o \ - xa-class-base.o \ - xa-class-audio-codec.o \ - xa-class-mixer.o \ - xf-main.o - -ifeq ($(XF_TRACE),1) - CFLAGS += -DXF_TRACE=1 - CFLAGS += -DXAF_PROFILE_DSP=1 -endif - -ifeq ($(XA_MP3_DECODER),1) - vpath %.c $(ROOTDIR)/plugins/cadence/mp3_dec - CFLAGS += -DXA_MP3_DECODER=1 - PLUGINO2OBJS += xa-mp3-decoder.o - PLUGINLIBS += $(ROOTDIR)/plugins/cadence/mp3_dec/lib/hifi2/xa_mp3_dec.a - PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/mp3_dec -endif - -ifeq ($(XA_PCM),1) - vpath %.c $(ROOTDIR)/plugins/cadence/pcm_proc - CFLAGS += -DXA_PCM=1 - PLUGINO2OBJS += xa-pcm.o - PLUGINLIBS += - PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/pcm_proc -endif - -ifeq ($(XA_VORBIS_DECODER),1) - vpath %.c $(ROOTDIR)/plugins/cadence/vorbis_dec - CFLAGS += -DXA_VORBIS_DECODER=1 - PLUGINO2OBJS += xa-vorbis-decoder.o - PLUGINLIBS += $(ROOTDIR)/plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a - PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/vorbis_dec -endif - -ifeq ($(XA_MIXER),1) - vpath %.c $(ROOTDIR)/plugins/cadence/mixer - CFLAGS += -DXA_MIXER=1 - PLUGINO2OBJS += xa-mixer.o - PLUGINLIBS += - PLUGININCLUDES += -I$(ROOTDIR)/plugins/cadence/mixer -endif - -LIBO2OBJS = $(LIBXAFO2OBJS) $(LIBMP3DECO2OBJS) $(LIBMIXERO2OBJS) $(PLUGINO2OBJS) -LIBASMOBJS = $(LIBXAFASMOBJS) - -INCLUDES += \ - -I$(ROOTDIR)/include \ - -I$(ROOTDIR)/include/audio \ - -I$(ROOTDIR)/include/sys/xt-shmem \ - -I$(ROOTDIR)/include/sys/xt-shmem/board-hikey \ - -I$(ROOTDIR)/plugins/cadence/mp3_dec - -INCLUDES += $(PLUGININCLUDES) - -LDFLAGS += -nostdlib -lhal -lhandlers-board -lc -lgcc -LDFLAGS += -mlsp="./hifi_hikey_lsp" - -HIKEY960: $(CODEC_NAME) - -include $(ROOTDIR)/build_hikey/common.mk diff --git a/hifi/xaf/hifi-dpf/build_hikey/common.mk b/hifi/xaf/hifi-dpf/build_hikey/common.mk deleted file mode 100644 index ef4429ea..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/common.mk +++ /dev/null @@ -1,156 +0,0 @@ -# -# Copyright (C) 2018 Cadence Design Systems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to use this Software with Cadence processor cores only and -# not with any other processors and platforms, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -QUIET = -MAPFILE = map_$(CODEC_NAME).txt -LDSCRIPT = ldscript_$(CODEC_NAME).txt -SYMFILE = symbols_$(CODEC_NAME).txt -ELFTOBIN = $(ROOTDIR)/build_hikey/tools/elftobin.sh - -ifeq ($(CPU), gcc) - S = / - AR = ar - OBJCOPY = objcopy - CC = gcc - CXX = g++ - CFLAGS += -fno-exceptions -DCSTUB=1 - CFLAGS += -ffloat-store - CFLAGS += -DHIFI3_CSTUB - RM = rm -f - RM_R = rm -rf - MKPATH = mkdir -p - CP = cp -f - INCLUDES += \ - -I$(ROOTDIR)/test/include -else - AR = xt-ar $(XTCORE) - OBJCOPY = xt-objcopy $(XTCORE) - CC = xt-xcc $(XTCORE) - CXX = xt-xc++ $(XTCORE) - ISS = xt-run $(XTCORE) - CONFIGDIR := $(shell $(ISS) --show-config=config) - include $(CONFIGDIR)/misc/hostenv.mk - #CFLAGS += -Wall - #CFLAGS += -Werror - #CFLAGS += -mno-mul16 -mno-mul32 -mno-div32 -fsigned-char -fno-exceptions -mlongcalls -INLINE:requested -mcoproc -fno-zero-initialized-in-bss - CFLAGS += -mlongcalls -mtext-section-literals - ASMFLAGS += -mlongcalls -endif - -OBJDIR = objs$(S)$(CODEC_NAME) -LIBDIR = $(ROOTDIR)$(S)lib - -OBJ_LIBO2OBJS = $(addprefix $(OBJDIR)/,$(LIBO2OBJS)) -OBJ_LIBOSOBJS = $(addprefix $(OBJDIR)/,$(LIBOSOBJS)) -OBJ_LIBO2CPPOBJS = $(addprefix $(OBJDIR)/,$(LIBO2CPPOBJS)) -OBJ_LIBOSCPPOBJS = $(addprefix $(OBJDIR)/,$(LIBOSCPPOBJS)) -OBJ_LIBASMOBJS = $(addprefix $(OBJDIR)/,$(LIBASMOBJS)) - -TEMPOBJ = temp.o - -ifeq ($(CPU), gcc) - LIBOBJ = $(OBJDIR)/xgcc_$(CODEC_NAME).o - LIB = xgcc_$(CODEC_NAME).img -else - LIBOBJ = $(OBJDIR)/xa_$(CODEC_NAME).o - LIB = xa_$(CODEC_NAME).img -endif - -CFLAGS += \ - $(EXTRA_CFLAGS) $(EXTRA_CFLAGS2) - - -ifeq ($(DEBUG),1) - NOSTRIP = 1 - OPT_O2 = -O0 -g - OPT_OS = -O0 -g - CFLAGS += -DDEBUG -else -ifeq ($(CPU), gcc) - OPT_O2 = -O2 -g - OPT_OS = -O2 -g -else - #OPT_O2 = -O3 -LNO:simd - OPT_O2 = -g -O2 - OPT_OS = -Os -endif -endif - -OPT_ASM = -g -Wa,--gdwarf-2 - - -all: $(OBJDIR) $(LIB) -$(CODEC_NAME): $(OBJDIR) $(LIB) - -install: $(LIB) - @echo "Installing $(LIB)" - $(QUIET) -$(MKPATH) "$(LIBDIR)" - $(QUIET) $(CP) $(LIB) "$(LIBDIR)" - -$(OBJDIR): - $(QUIET) -$(MKPATH) $@ - -ifeq ($(NOSTRIP), 1) -$(LIBOBJ): $(OBJ_LIBO2OBJS) $(OBJ_LIBOSOBJS) $(OBJ_LIBO2CPPOBJS) $(OBJ_LIBOSCPPOBJS) $(OBJ_LIBASMOBJS) $(PLUGINLIBS) - @echo "Linking Objects" - $(QUIET) $(CXX) -c $(OPT_O2) $(CFLAGS) -o $@ $^ \ - -Wl,-Map,$(MAPFILE) --no-standard-libraries \ - $(LDFLAGS) $(EXTRA_LDFLAGS) -else -$(LIBOBJ): $(OBJ_LIBO2OBJS) $(OBJ_LIBOSOBJS) $(OBJ_LIBO2CPPOBJS) $(OBJ_LIBOSCPPOBJS) $(OBJ_LIBASMOBJS) $(PLUGINLIBS) - @echo "Linking Objects" - $(QUIET) $(CXX) -c $(OPT_O2) $(CFLAGS) -o $@ $^ \ - -Wl,-Map,$(MAPFILE) --no-standard-libraries \ - -Wl,--retain-symbols-file,$(SYMFILE) \ - $(IPA_FLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) - $(QUIET) $(OBJCOPY) --keep-global-symbols=$(SYMFILE) $@ $(TEMPOBJ) - $(QUIET) $(OBJCOPY) --strip-unneeded $(TEMPOBJ) $@ - $(QUIET) -$(RM) $(TEMPOBJ) -endif - - -$(OBJ_LIBO2OBJS): $(OBJDIR)/%.o: %.c - @echo "Compiling $<" - $(QUIET) $(CC) -o $@ $(OPT_O2) $(CFLAGS) $(INCLUDES) -c $< - -$(OBJ_LIBOSOBJS): $(OBJDIR)/%.o: %.c - @echo "Compiling $<" - $(QUIET) $(CC) -o $@ $(OPT_OS) $(CFLAGS) $(INCLUDES) -c $< - -$(OBJ_LIBO2CPPOBJS): $(OBJDIR)/%.o: %.cpp - @echo "Compiling $<" - $(QUIET) $(CXX) -o $@ $(OPT_O2) $(CFLAGS) $(INCLUDES) -c $< - -$(OBJ_LIBOSCPPOBJS): $(OBJDIR)/%.o: %.cpp - @echo "Compiling $<" - $(QUIET) $(CXX) -o $@ $(OPT_OS) $(CFLAGS) $(INCLUDES) -c $< - -$(OBJ_LIBASMOBJS): $(OBJDIR)/%.o: %.S - @echo "Compiling $<" - $(QUIET) $(CC) -o $@ $(OPT_ASM) $(ASMFLAGS) $(INCLUDES) -c $< - -$(LIB): %.img: $(OBJDIR)/%.o - @echo "Creating Library $@" - $(ELFTOBIN) $< $@ - -clean: - -$(RM) $(LIB) $(MAPFILE) - -$(RM_R) $(OBJDIR) $(LIBDIR) diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.x b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.x deleted file mode 100644 index 67507ed3..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.x +++ /dev/null @@ -1,827 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP hifi_hikey_lsp */ -/* Linker Script for default link */ -MEMORY -{ - sram0_seg : org = 0xC0000000, len = 0x408000 - old_vlpd_seg : org = 0xC0408000, len = 0x10000 - efr_fr_hr_vlpd_seg : org = 0xC0418000, len = 0x10000 - amr_vlpd_seg : org = 0xC0428000, len = 0x10000 - amrwb_vlpd_seg : org = 0xC0438000, len = 0x10000 - evrc_evrcb_vlpt_seg : org = 0xC0448000, len = 0x48000 - efr_fr_hr_vlpt_seg : org = 0xC0490000, len = 0x30000 - amr_vlpt_seg : org = 0xC04C0000, len = 0x20000 - amrwb_vlpt_seg : org = 0xC04E0000, len = 0x30000 - vlpt_seg : org = 0xC0510000, len = 0x48000 - vlpd_seg : org = 0xC0558000, len = 0x20000 - ulpp_seg : org = 0xC0578000, len = 0x40000 - dtsv3_seg : org = 0xC05B8000, len = 0x20000 - dtsv4_seg : org = 0xC05D8000, len = 0x28000 - dram0_0_seg : org = 0xE8058000, len = 0x28000 - iram0_0_seg : org = 0xE8080000, len = 0x300 - iram0_1_seg : org = 0xE8080300, len = 0x100 - iram0_2_seg : org = 0xE8080400, len = 0x178 - iram0_3_seg : org = 0xE8080578, len = 0x8 - iram0_4_seg : org = 0xE8080580, len = 0x38 - iram0_5_seg : org = 0xE80805B8, len = 0x8 - iram0_6_seg : org = 0xE80805C0, len = 0x38 - iram0_7_seg : org = 0xE80805F8, len = 0x8 - iram0_8_seg : org = 0xE8080600, len = 0x38 - iram0_9_seg : org = 0xE8080638, len = 0x8 - iram0_10_seg : org = 0xE8080640, len = 0x38 - iram0_11_seg : org = 0xE8080678, len = 0x48 - iram0_12_seg : org = 0xE80806C0, len = 0x38 - iram0_13_seg : org = 0xE80806F8, len = 0x8 - iram0_14_seg : org = 0xE8080700, len = 0x38 - iram0_15_seg : org = 0xE8080738, len = 0x8 - iram0_16_seg : org = 0xE8080740, len = 0x38 - iram0_17_seg : org = 0xE8080778, len = 0x48 - iram0_18_seg : org = 0xE80807C0, len = 0x40 - iram0_19_seg : org = 0xE8080800, len = 0xB800 -} - -PHDRS -{ - sram0_phdr PT_LOAD; - sram0_bss_phdr PT_LOAD; - old_vlpd_phdr PT_LOAD; - old_vlpd_bss_phdr PT_LOAD; - efr_fr_hr_vlpd_phdr PT_LOAD; - efr_fr_hr_vlpd_bss_phdr PT_LOAD; - amr_vlpd_phdr PT_LOAD; - amr_vlpd_bss_phdr PT_LOAD; - amrwb_vlpd_phdr PT_LOAD; - amrwb_vlpd_bss_phdr PT_LOAD; - evrc_evrcb_vlpt_phdr PT_LOAD; - efr_fr_hr_vlpt_phdr PT_LOAD; - amr_vlpt_phdr PT_LOAD; - amrwb_vlpt_phdr PT_LOAD; - vlpt_phdr PT_LOAD; - vlpd_phdr PT_LOAD; - ulpp_phdr PT_LOAD; - ulpp_bss_phdr PT_LOAD; - dtsv3_phdr PT_LOAD; - dtsv3_bss_phdr PT_LOAD; - dtsv4_phdr PT_LOAD; - dtsv4_bss_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram0_0_phdr PT_LOAD; - iram0_1_phdr PT_LOAD; - iram0_2_phdr PT_LOAD; - iram0_3_phdr PT_LOAD; - iram0_4_phdr PT_LOAD; - iram0_5_phdr PT_LOAD; - iram0_6_phdr PT_LOAD; - iram0_7_phdr PT_LOAD; - iram0_8_phdr PT_LOAD; - iram0_9_phdr PT_LOAD; - iram0_10_phdr PT_LOAD; - iram0_11_phdr PT_LOAD; - iram0_12_phdr PT_LOAD; - iram0_13_phdr PT_LOAD; - iram0_14_phdr PT_LOAD; - iram0_15_phdr PT_LOAD; - iram0_16_phdr PT_LOAD; - iram0_17_phdr PT_LOAD; - iram0_18_phdr PT_LOAD; - iram0_19_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(_ResetVector) - -/* Memory boundary addresses: */ -_memmap_mem_iram0_start = 0xe8080000; -_memmap_mem_iram0_end = 0xe808c000; -_memmap_mem_dram0_start = 0xe8058000; -_memmap_mem_dram0_end = 0xe8080000; -_memmap_mem_sram_start = 0xc0000000; -_memmap_mem_sram_end = 0xc0600000; - -/* Memory segment boundary addresses: */ -_memmap_seg_sram0_start = 0xc0000000; -_memmap_seg_sram0_max = 0xc0408000; -_memmap_seg_old_vlpd_start = 0xc0408000; -_memmap_seg_old_vlpd_max = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_start = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_max = 0xc0428000; -_memmap_seg_amr_vlpd_start = 0xc0428000; -_memmap_seg_amr_vlpd_max = 0xc0438000; -_memmap_seg_amrwb_vlpd_start = 0xc0438000; -_memmap_seg_amrwb_vlpd_max = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_start = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_max = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_start = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_max = 0xc04c0000; -_memmap_seg_amr_vlpt_start = 0xc04c0000; -_memmap_seg_amr_vlpt_max = 0xc04e0000; -_memmap_seg_amrwb_vlpt_start = 0xc04e0000; -_memmap_seg_amrwb_vlpt_max = 0xc0510000; -_memmap_seg_vlpt_start = 0xc0510000; -_memmap_seg_vlpt_max = 0xc0558000; -_memmap_seg_vlpd_start = 0xc0558000; -_memmap_seg_vlpd_max = 0xc0578000; -_memmap_seg_ulpp_start = 0xc0578000; -_memmap_seg_ulpp_max = 0xc05b8000; -_memmap_seg_dtsv3_start = 0xc05b8000; -_memmap_seg_dtsv3_max = 0xc05d8000; -_memmap_seg_dtsv4_start = 0xc05d8000; -_memmap_seg_dtsv4_max = 0xc0600000; -_memmap_seg_dram0_0_start = 0xe8058000; -_memmap_seg_dram0_0_max = 0xe8080000; -_memmap_seg_iram0_0_start = 0xe8080000; -_memmap_seg_iram0_0_max = 0xe8080300; -_memmap_seg_iram0_1_start = 0xe8080300; -_memmap_seg_iram0_1_max = 0xe8080400; -_memmap_seg_iram0_2_start = 0xe8080400; -_memmap_seg_iram0_2_max = 0xe8080578; -_memmap_seg_iram0_3_start = 0xe8080578; -_memmap_seg_iram0_3_max = 0xe8080580; -_memmap_seg_iram0_4_start = 0xe8080580; -_memmap_seg_iram0_4_max = 0xe80805b8; -_memmap_seg_iram0_5_start = 0xe80805b8; -_memmap_seg_iram0_5_max = 0xe80805c0; -_memmap_seg_iram0_6_start = 0xe80805c0; -_memmap_seg_iram0_6_max = 0xe80805f8; -_memmap_seg_iram0_7_start = 0xe80805f8; -_memmap_seg_iram0_7_max = 0xe8080600; -_memmap_seg_iram0_8_start = 0xe8080600; -_memmap_seg_iram0_8_max = 0xe8080638; -_memmap_seg_iram0_9_start = 0xe8080638; -_memmap_seg_iram0_9_max = 0xe8080640; -_memmap_seg_iram0_10_start = 0xe8080640; -_memmap_seg_iram0_10_max = 0xe8080678; -_memmap_seg_iram0_11_start = 0xe8080678; -_memmap_seg_iram0_11_max = 0xe80806c0; -_memmap_seg_iram0_12_start = 0xe80806c0; -_memmap_seg_iram0_12_max = 0xe80806f8; -_memmap_seg_iram0_13_start = 0xe80806f8; -_memmap_seg_iram0_13_max = 0xe8080700; -_memmap_seg_iram0_14_start = 0xe8080700; -_memmap_seg_iram0_14_max = 0xe8080738; -_memmap_seg_iram0_15_start = 0xe8080738; -_memmap_seg_iram0_15_max = 0xe8080740; -_memmap_seg_iram0_16_start = 0xe8080740; -_memmap_seg_iram0_16_max = 0xe8080778; -_memmap_seg_iram0_17_start = 0xe8080778; -_memmap_seg_iram0_17_max = 0xe80807c0; -_memmap_seg_iram0_18_start = 0xe80807c0; -_memmap_seg_iram0_18_max = 0xe8080800; -_memmap_seg_iram0_19_start = 0xe8080800; -_memmap_seg_iram0_19_max = 0xe808c000; - -_rom_store_table = 0; -PROVIDE(_memmap_vecbase_reset = 0xe8080400); -PROVIDE(_memmap_reset_vector = 0xe8080000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x44000000; -_memmap_cacheattr_wt_base = 0x11000000; -_memmap_cacheattr_bp_base = 0x22000000; -_memmap_cacheattr_unused_mask = 0x00FFFFFF; -_memmap_cacheattr_wb_trapnull = 0x4422222F; -_memmap_cacheattr_wba_trapnull = 0x4422222F; -_memmap_cacheattr_wbna_trapnull = 0x5522222F; -_memmap_cacheattr_wt_trapnull = 0x1122222F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0x44FFFFFF; -_memmap_cacheattr_wt_strict = 0x11FFFFFF; -_memmap_cacheattr_bp_strict = 0x22FFFFFF; -_memmap_cacheattr_wb_allvalid = 0x44222222; -_memmap_cacheattr_wt_allvalid = 0x11222222; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .vlpd.rodata : ALIGN(4) - { - _vlpd_rodata_start = ABSOLUTE(.); - *(.vlpd.rodata) - _vlpd_rodata_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.data : ALIGN(4) - { - _vlpd_data_start = ABSOLUTE(.); - *(.vlpd.data) - _vlpd_data_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _vlpd_bss_start = ABSOLUTE(.); - *(.vlpd.bss) - . = ALIGN (8); - _vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_old_vlpd_end = ALIGN(0x8); - } >old_vlpd_seg :old_vlpd_bss_phdr - - .efr_fr_hr_vlpd.rodata : ALIGN(4) - { - _efr_fr_hr_vlpd_rodata_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.rodata) - _efr_fr_hr_vlpd_rodata_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.data : ALIGN(4) - { - _efr_fr_hr_vlpd_data_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.data) - _efr_fr_hr_vlpd_data_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.bss) - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpd_end = ALIGN(0x8); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_bss_phdr - - .amr_vlpd.rodata : ALIGN(4) - { - _amr_vlpd_rodata_start = ABSOLUTE(.); - *(.amr_vlpd.rodata) - _amr_vlpd_rodata_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.data : ALIGN(4) - { - _amr_vlpd_data_start = ABSOLUTE(.); - *(.amr_vlpd.data) - _amr_vlpd_data_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amr_vlpd_bss_start = ABSOLUTE(.); - *(.amr_vlpd.bss) - . = ALIGN (8); - _amr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amr_vlpd_end = ALIGN(0x8); - } >amr_vlpd_seg :amr_vlpd_bss_phdr - - .amrwb_vlpd.rodata : ALIGN(4) - { - _amrwb_vlpd_rodata_start = ABSOLUTE(.); - *(.amrwb_vlpd.rodata) - _amrwb_vlpd_rodata_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.data : ALIGN(4) - { - _amrwb_vlpd_data_start = ABSOLUTE(.); - *(.amrwb_vlpd.data) - _amrwb_vlpd_data_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amrwb_vlpd_bss_start = ABSOLUTE(.); - *(.amrwb_vlpd.bss) - . = ALIGN (8); - _amrwb_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpd_end = ALIGN(0x8); - } >amrwb_vlpd_seg :amrwb_vlpd_bss_phdr - - .evrc_evrcb_vlpt.text : ALIGN(4) - { - _evrc_evrcb_vlpt_text_start = ABSOLUTE(.); - *(.evrc_evrcb_vlpt.literal .evrc_evrcb_vlpt.text) - _evrc_evrcb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_evrc_evrcb_vlpt_end = ALIGN(0x8); - } >evrc_evrcb_vlpt_seg :evrc_evrcb_vlpt_phdr - - .efr_fr_hr_vlpt.text : ALIGN(4) - { - _efr_fr_hr_vlpt_text_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpt.literal .efr_fr_hr_vlpt.text) - _efr_fr_hr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpt_end = ALIGN(0x8); - } >efr_fr_hr_vlpt_seg :efr_fr_hr_vlpt_phdr - - .amr_vlpt.text : ALIGN(4) - { - _amr_vlpt_text_start = ABSOLUTE(.); - *(.amr_vlpt.literal .amr_vlpt.text) - _amr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amr_vlpt_end = ALIGN(0x8); - } >amr_vlpt_seg :amr_vlpt_phdr - - .amrwb_vlpt.text : ALIGN(4) - { - _amrwb_vlpt_text_start = ABSOLUTE(.); - *(.amrwb_vlpt.literal .amrwb_vlpt.text) - _amrwb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpt_end = ALIGN(0x8); - } >amrwb_vlpt_seg :amrwb_vlpt_phdr - - .vlpt.text : ALIGN(4) - { - _vlpt_text_start = ABSOLUTE(.); - *(.vlpt.literal .vlpt.text) - _vlpt_text_end = ABSOLUTE(.); - _memmap_seg_vlpt_end = ALIGN(0x8); - } >vlpt_seg :vlpt_phdr - - .low_power_dyn_alloc : ALIGN(4) - { - _low_power_dyn_alloc_start = ABSOLUTE(.); - *(.low_power_dyn_alloc) - _low_power_dyn_alloc_end = ABSOLUTE(.); - _memmap_seg_vlpd_end = ALIGN(0x8); - } >vlpd_seg :vlpd_phdr - - .ulpp.rodata : ALIGN(4) - { - _ulpp_rodata_start = ABSOLUTE(.); - *(.ulpp.rodata) - _ulpp_rodata_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.data : ALIGN(4) - { - _ulpp_data_start = ABSOLUTE(.); - *(.ulpp.data) - _ulpp_data_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.text : ALIGN(4) - { - _ulpp_text_start = ABSOLUTE(.); - *(.ulpp.literal .ulpp.text) - _ulpp_text_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _ulpp_bss_start = ABSOLUTE(.); - *(.ulpp.bss) - . = ALIGN (8); - _ulpp_bss_end = ABSOLUTE(.); - _memmap_seg_ulpp_end = ALIGN(0x8); - } >ulpp_seg :ulpp_bss_phdr - - .dtsv3.rodata : ALIGN(4) - { - _dtsv3_rodata_start = ABSOLUTE(.); - *(.dtsv3.rodata) - _dtsv3_rodata_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.data : ALIGN(4) - { - _dtsv3_data_start = ABSOLUTE(.); - *(.dtsv3.data) - _dtsv3_data_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.text : ALIGN(4) - { - _dtsv3_text_start = ABSOLUTE(.); - *(.dtsv3.literal .dtsv3.text) - _dtsv3_text_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv3_bss_start = ABSOLUTE(.); - *(.dtsv3.bss) - . = ALIGN (8); - _dtsv3_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv3_end = ALIGN(0x8); - } >dtsv3_seg :dtsv3_bss_phdr - - .dtsv4.rodata : ALIGN(4) - { - _dtsv4_rodata_start = ABSOLUTE(.); - *(.dtsv4.rodata) - _dtsv4_rodata_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.data : ALIGN(4) - { - _dtsv4_data_start = ABSOLUTE(.); - *(.dtsv4.data) - _dtsv4_data_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.text : ALIGN(4) - { - _dtsv4_text_start = ABSOLUTE(.); - *(.dtsv4.literal .dtsv4.text) - _dtsv4_text_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv4_bss_start = ABSOLUTE(.); - *(.dtsv4.bss) - . = ALIGN (8); - _dtsv4_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv4_end = ALIGN(0x8); - } >dtsv4_seg :dtsv4_bss_phdr - - .dram0.rodata : ALIGN(4) - { - _dram0_rodata_start = ABSOLUTE(.); - *(.dram0.rodata) - *(.dram.rodata) - _dram0_rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.literal : ALIGN(4) - { - _dram0_literal_start = ABSOLUTE(.); - *(.dram0.literal) - *(.dram.literal) - _dram0_literal_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.data : ALIGN(4) - { - _dram0_data_start = ABSOLUTE(.); - *(.dram0.data) - *(.dram.data) - _dram0_data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dram0_bss_start = ABSOLUTE(.); - *(.dram0.bss) - *(.om.debug.bss) - *(.os.stack.bss) - . = ALIGN (8); - _dram0_bss_end = ABSOLUTE(.); - _end = ALIGN(0x8); - PROVIDE(end = ALIGN(0x8)); - _stack_sentry = ALIGN(0x8); - _memmap_seg_dram0_0_end = ALIGN(0x8); - } >dram0_0_seg :dram0_0_bss_phdr - __stack = 0xe8080000; - _heap_sentry = 0xe8080000; - - .ResetVector.text : ALIGN(4) - { - _ResetVector_text_start = ABSOLUTE(.); - KEEP (*(.ResetVector.text)) - _ResetVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_0_end = ALIGN(0x8); - } >iram0_0_seg :iram0_0_phdr - - .Reset.literal : ALIGN(4) - { - _Reset_literal_start = ABSOLUTE(.); - *(.Reset.literal) - _Reset_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_1_end = ALIGN(0x8); - } >iram0_1_seg :iram0_1_phdr - - .WindowVectors.text : ALIGN(4) - { - _WindowVectors_text_start = ABSOLUTE(.); - KEEP (*(.WindowVectors.text)) - _WindowVectors_text_end = ABSOLUTE(.); - _memmap_seg_iram0_2_end = ALIGN(0x8); - } >iram0_2_seg :iram0_2_phdr - - .Level2InterruptVector.literal : ALIGN(4) - { - _Level2InterruptVector_literal_start = ABSOLUTE(.); - *(.Level2InterruptVector.literal) - _Level2InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_3_end = ALIGN(0x8); - } >iram0_3_seg :iram0_3_phdr - - .Level2InterruptVector.text : ALIGN(4) - { - _Level2InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level2InterruptVector.text)) - _Level2InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_4_end = ALIGN(0x8); - } >iram0_4_seg :iram0_4_phdr - - .Level3InterruptVector.literal : ALIGN(4) - { - _Level3InterruptVector_literal_start = ABSOLUTE(.); - *(.Level3InterruptVector.literal) - _Level3InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_5_end = ALIGN(0x8); - } >iram0_5_seg :iram0_5_phdr - - .Level3InterruptVector.text : ALIGN(4) - { - _Level3InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level3InterruptVector.text)) - _Level3InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_6_end = ALIGN(0x8); - } >iram0_6_seg :iram0_6_phdr - - .Level4InterruptVector.literal : ALIGN(4) - { - _Level4InterruptVector_literal_start = ABSOLUTE(.); - *(.Level4InterruptVector.literal) - _Level4InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_7_end = ALIGN(0x8); - } >iram0_7_seg :iram0_7_phdr - - .Level4InterruptVector.text : ALIGN(4) - { - _Level4InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level4InterruptVector.text)) - _Level4InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_8_end = ALIGN(0x8); - } >iram0_8_seg :iram0_8_phdr - - .DebugExceptionVector.literal : ALIGN(4) - { - _DebugExceptionVector_literal_start = ABSOLUTE(.); - *(.DebugExceptionVector.literal) - _DebugExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_9_end = ALIGN(0x8); - } >iram0_9_seg :iram0_9_phdr - - .DebugExceptionVector.text : ALIGN(4) - { - _DebugExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DebugExceptionVector.text)) - _DebugExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_10_end = ALIGN(0x8); - } >iram0_10_seg :iram0_10_phdr - - .NMIExceptionVector.literal : ALIGN(4) - { - _NMIExceptionVector_literal_start = ABSOLUTE(.); - *(.NMIExceptionVector.literal) - _NMIExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_11_end = ALIGN(0x8); - } >iram0_11_seg :iram0_11_phdr - - .NMIExceptionVector.text : ALIGN(4) - { - _NMIExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.NMIExceptionVector.text)) - _NMIExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_12_end = ALIGN(0x8); - } >iram0_12_seg :iram0_12_phdr - - .KernelExceptionVector.literal : ALIGN(4) - { - _KernelExceptionVector_literal_start = ABSOLUTE(.); - *(.KernelExceptionVector.literal) - _KernelExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_13_end = ALIGN(0x8); - } >iram0_13_seg :iram0_13_phdr - - .KernelExceptionVector.text : ALIGN(4) - { - _KernelExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.KernelExceptionVector.text)) - _KernelExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_14_end = ALIGN(0x8); - } >iram0_14_seg :iram0_14_phdr - - .UserExceptionVector.literal : ALIGN(4) - { - _UserExceptionVector_literal_start = ABSOLUTE(.); - *(.UserExceptionVector.literal) - _UserExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_15_end = ALIGN(0x8); - } >iram0_15_seg :iram0_15_phdr - - .UserExceptionVector.text : ALIGN(4) - { - _UserExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.UserExceptionVector.text)) - _UserExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_16_end = ALIGN(0x8); - } >iram0_16_seg :iram0_16_phdr - - .DoubleExceptionVector.literal : ALIGN(4) - { - _DoubleExceptionVector_literal_start = ABSOLUTE(.); - *(.DoubleExceptionVector.literal) - _DoubleExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_17_end = ALIGN(0x8); - } >iram0_17_seg :iram0_17_phdr - - .DoubleExceptionVector.text : ALIGN(4) - { - _DoubleExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DoubleExceptionVector.text)) - _DoubleExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_18_end = ALIGN(0x8); - } >iram0_18_seg :iram0_18_phdr - - .Reset.text : ALIGN(4) - { - _Reset_text_start = ABSOLUTE(.); - *(.Reset.text) - _Reset_text_end = ABSOLUTE(.); - } >iram0_19_seg :iram0_19_phdr - - .iram0.text : ALIGN(4) - { - _iram0_text_start = ABSOLUTE(.); - *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text) - _iram0_text_end = ABSOLUTE(.); - _memmap_seg_iram0_19_end = ALIGN(0x8); - } >iram0_19_seg :iram0_19_phdr - - .sram.shareaddr : ALIGN(4) - { - _sram_shareaddr_start = ABSOLUTE(.); - *(.sram.shareaddr) - _sram_shareaddr_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.rodata : ALIGN(4) - { - _sram_rodata_start = ABSOLUTE(.); - *(.sram.rodata) - _sram_rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - KEEP (*(.xt_except_table)) - KEEP (*(.gcc_except_table)) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - KEEP (*(.eh_frame)) - /* C++ constructor and destructor tables, properly ordered: */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_vlpd_bss_start) - LONG(_vlpd_bss_end) - LONG(_efr_fr_hr_vlpd_bss_start) - LONG(_efr_fr_hr_vlpd_bss_end) - LONG(_amr_vlpd_bss_start) - LONG(_amr_vlpd_bss_end) - LONG(_amrwb_vlpd_bss_start) - LONG(_amrwb_vlpd_bss_end) - LONG(_ulpp_bss_start) - LONG(_ulpp_bss_end) - LONG(_dtsv3_bss_start) - LONG(_dtsv3_bss_end) - LONG(_dtsv4_bss_start) - LONG(_dtsv4_bss_end) - LONG(_dram0_bss_start) - LONG(_dram0_bss_end) - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.text : ALIGN(4) - { - _sram_text_start = ABSOLUTE(.); - *(.sram.literal .sram.text) - _sram_text_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.entry.text) - *(.init.literal) - KEEP(*(.init)) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - KEEP(*(.fini)) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >sram0_seg :sram0_phdr - - .sram.data : ALIGN(4) - { - _sram_data_start = ABSOLUTE(.); - *(.sram.data) - _sram_data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - KEEP(*(.gnu.linkonce.d.*personality*)) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - KEEP(*(.jcr)) - _data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.uninit : ALIGN(4) - { - _sram_uninit_start = ABSOLUTE(.); - *(.sram.uninit) - _sram_uninit_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - *(.sram.pool.bss) - *(.sram.bss) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _memmap_seg_sram0_end = ALIGN(0x8); - } >sram0_seg :sram0_bss_phdr - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .xt.insn 0 : - { - KEEP (*(.xt.insn)) - KEEP (*(.gnu.linkonce.x.*)) - } - .xt.prop 0 : - { - KEEP (*(.xt.prop)) - KEEP (*(.xt.prop.*)) - KEEP (*(.gnu.linkonce.prop.*)) - } - .xt.lit 0 : - { - KEEP (*(.xt.lit)) - KEEP (*(.xt.lit.*)) - KEEP (*(.gnu.linkonce.p.*)) - } - .debug.xt.callgraph 0 : - { - KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) - } -} - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xbn b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xbn deleted file mode 100644 index e226d641..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xbn +++ /dev/null @@ -1,827 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP hifi_hikey_lsp */ -/* Linker Script for ld -N */ -MEMORY -{ - sram0_seg : org = 0xC0000000, len = 0x408000 - old_vlpd_seg : org = 0xC0408000, len = 0x10000 - efr_fr_hr_vlpd_seg : org = 0xC0418000, len = 0x10000 - amr_vlpd_seg : org = 0xC0428000, len = 0x10000 - amrwb_vlpd_seg : org = 0xC0438000, len = 0x10000 - evrc_evrcb_vlpt_seg : org = 0xC0448000, len = 0x48000 - efr_fr_hr_vlpt_seg : org = 0xC0490000, len = 0x30000 - amr_vlpt_seg : org = 0xC04C0000, len = 0x20000 - amrwb_vlpt_seg : org = 0xC04E0000, len = 0x30000 - vlpt_seg : org = 0xC0510000, len = 0x48000 - vlpd_seg : org = 0xC0558000, len = 0x20000 - ulpp_seg : org = 0xC0578000, len = 0x40000 - dtsv3_seg : org = 0xC05B8000, len = 0x20000 - dtsv4_seg : org = 0xC05D8000, len = 0x28000 - dram0_0_seg : org = 0xE8058000, len = 0x28000 - iram0_0_seg : org = 0xE8080000, len = 0x300 - iram0_1_seg : org = 0xE8080300, len = 0x100 - iram0_2_seg : org = 0xE8080400, len = 0x178 - iram0_3_seg : org = 0xE8080578, len = 0x8 - iram0_4_seg : org = 0xE8080580, len = 0x38 - iram0_5_seg : org = 0xE80805B8, len = 0x8 - iram0_6_seg : org = 0xE80805C0, len = 0x38 - iram0_7_seg : org = 0xE80805F8, len = 0x8 - iram0_8_seg : org = 0xE8080600, len = 0x38 - iram0_9_seg : org = 0xE8080638, len = 0x8 - iram0_10_seg : org = 0xE8080640, len = 0x38 - iram0_11_seg : org = 0xE8080678, len = 0x48 - iram0_12_seg : org = 0xE80806C0, len = 0x38 - iram0_13_seg : org = 0xE80806F8, len = 0x8 - iram0_14_seg : org = 0xE8080700, len = 0x38 - iram0_15_seg : org = 0xE8080738, len = 0x8 - iram0_16_seg : org = 0xE8080740, len = 0x38 - iram0_17_seg : org = 0xE8080778, len = 0x48 - iram0_18_seg : org = 0xE80807C0, len = 0x40 - iram0_19_seg : org = 0xE8080800, len = 0xB800 -} - -PHDRS -{ - sram0_phdr PT_LOAD; - sram0_bss_phdr PT_LOAD; - old_vlpd_phdr PT_LOAD; - old_vlpd_bss_phdr PT_LOAD; - efr_fr_hr_vlpd_phdr PT_LOAD; - efr_fr_hr_vlpd_bss_phdr PT_LOAD; - amr_vlpd_phdr PT_LOAD; - amr_vlpd_bss_phdr PT_LOAD; - amrwb_vlpd_phdr PT_LOAD; - amrwb_vlpd_bss_phdr PT_LOAD; - evrc_evrcb_vlpt_phdr PT_LOAD; - efr_fr_hr_vlpt_phdr PT_LOAD; - amr_vlpt_phdr PT_LOAD; - amrwb_vlpt_phdr PT_LOAD; - vlpt_phdr PT_LOAD; - vlpd_phdr PT_LOAD; - ulpp_phdr PT_LOAD; - ulpp_bss_phdr PT_LOAD; - dtsv3_phdr PT_LOAD; - dtsv3_bss_phdr PT_LOAD; - dtsv4_phdr PT_LOAD; - dtsv4_bss_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram0_0_phdr PT_LOAD; - iram0_1_phdr PT_LOAD; - iram0_2_phdr PT_LOAD; - iram0_3_phdr PT_LOAD; - iram0_4_phdr PT_LOAD; - iram0_5_phdr PT_LOAD; - iram0_6_phdr PT_LOAD; - iram0_7_phdr PT_LOAD; - iram0_8_phdr PT_LOAD; - iram0_9_phdr PT_LOAD; - iram0_10_phdr PT_LOAD; - iram0_11_phdr PT_LOAD; - iram0_12_phdr PT_LOAD; - iram0_13_phdr PT_LOAD; - iram0_14_phdr PT_LOAD; - iram0_15_phdr PT_LOAD; - iram0_16_phdr PT_LOAD; - iram0_17_phdr PT_LOAD; - iram0_18_phdr PT_LOAD; - iram0_19_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(_ResetVector) - -/* Memory boundary addresses: */ -_memmap_mem_iram0_start = 0xe8080000; -_memmap_mem_iram0_end = 0xe808c000; -_memmap_mem_dram0_start = 0xe8058000; -_memmap_mem_dram0_end = 0xe8080000; -_memmap_mem_sram_start = 0xc0000000; -_memmap_mem_sram_end = 0xc0600000; - -/* Memory segment boundary addresses: */ -_memmap_seg_sram0_start = 0xc0000000; -_memmap_seg_sram0_max = 0xc0408000; -_memmap_seg_old_vlpd_start = 0xc0408000; -_memmap_seg_old_vlpd_max = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_start = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_max = 0xc0428000; -_memmap_seg_amr_vlpd_start = 0xc0428000; -_memmap_seg_amr_vlpd_max = 0xc0438000; -_memmap_seg_amrwb_vlpd_start = 0xc0438000; -_memmap_seg_amrwb_vlpd_max = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_start = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_max = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_start = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_max = 0xc04c0000; -_memmap_seg_amr_vlpt_start = 0xc04c0000; -_memmap_seg_amr_vlpt_max = 0xc04e0000; -_memmap_seg_amrwb_vlpt_start = 0xc04e0000; -_memmap_seg_amrwb_vlpt_max = 0xc0510000; -_memmap_seg_vlpt_start = 0xc0510000; -_memmap_seg_vlpt_max = 0xc0558000; -_memmap_seg_vlpd_start = 0xc0558000; -_memmap_seg_vlpd_max = 0xc0578000; -_memmap_seg_ulpp_start = 0xc0578000; -_memmap_seg_ulpp_max = 0xc05b8000; -_memmap_seg_dtsv3_start = 0xc05b8000; -_memmap_seg_dtsv3_max = 0xc05d8000; -_memmap_seg_dtsv4_start = 0xc05d8000; -_memmap_seg_dtsv4_max = 0xc0600000; -_memmap_seg_dram0_0_start = 0xe8058000; -_memmap_seg_dram0_0_max = 0xe8080000; -_memmap_seg_iram0_0_start = 0xe8080000; -_memmap_seg_iram0_0_max = 0xe8080300; -_memmap_seg_iram0_1_start = 0xe8080300; -_memmap_seg_iram0_1_max = 0xe8080400; -_memmap_seg_iram0_2_start = 0xe8080400; -_memmap_seg_iram0_2_max = 0xe8080578; -_memmap_seg_iram0_3_start = 0xe8080578; -_memmap_seg_iram0_3_max = 0xe8080580; -_memmap_seg_iram0_4_start = 0xe8080580; -_memmap_seg_iram0_4_max = 0xe80805b8; -_memmap_seg_iram0_5_start = 0xe80805b8; -_memmap_seg_iram0_5_max = 0xe80805c0; -_memmap_seg_iram0_6_start = 0xe80805c0; -_memmap_seg_iram0_6_max = 0xe80805f8; -_memmap_seg_iram0_7_start = 0xe80805f8; -_memmap_seg_iram0_7_max = 0xe8080600; -_memmap_seg_iram0_8_start = 0xe8080600; -_memmap_seg_iram0_8_max = 0xe8080638; -_memmap_seg_iram0_9_start = 0xe8080638; -_memmap_seg_iram0_9_max = 0xe8080640; -_memmap_seg_iram0_10_start = 0xe8080640; -_memmap_seg_iram0_10_max = 0xe8080678; -_memmap_seg_iram0_11_start = 0xe8080678; -_memmap_seg_iram0_11_max = 0xe80806c0; -_memmap_seg_iram0_12_start = 0xe80806c0; -_memmap_seg_iram0_12_max = 0xe80806f8; -_memmap_seg_iram0_13_start = 0xe80806f8; -_memmap_seg_iram0_13_max = 0xe8080700; -_memmap_seg_iram0_14_start = 0xe8080700; -_memmap_seg_iram0_14_max = 0xe8080738; -_memmap_seg_iram0_15_start = 0xe8080738; -_memmap_seg_iram0_15_max = 0xe8080740; -_memmap_seg_iram0_16_start = 0xe8080740; -_memmap_seg_iram0_16_max = 0xe8080778; -_memmap_seg_iram0_17_start = 0xe8080778; -_memmap_seg_iram0_17_max = 0xe80807c0; -_memmap_seg_iram0_18_start = 0xe80807c0; -_memmap_seg_iram0_18_max = 0xe8080800; -_memmap_seg_iram0_19_start = 0xe8080800; -_memmap_seg_iram0_19_max = 0xe808c000; - -_rom_store_table = 0; -PROVIDE(_memmap_vecbase_reset = 0xe8080400); -PROVIDE(_memmap_reset_vector = 0xe8080000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x44000000; -_memmap_cacheattr_wt_base = 0x11000000; -_memmap_cacheattr_bp_base = 0x22000000; -_memmap_cacheattr_unused_mask = 0x00FFFFFF; -_memmap_cacheattr_wb_trapnull = 0x4422222F; -_memmap_cacheattr_wba_trapnull = 0x4422222F; -_memmap_cacheattr_wbna_trapnull = 0x5522222F; -_memmap_cacheattr_wt_trapnull = 0x1122222F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0x44FFFFFF; -_memmap_cacheattr_wt_strict = 0x11FFFFFF; -_memmap_cacheattr_bp_strict = 0x22FFFFFF; -_memmap_cacheattr_wb_allvalid = 0x44222222; -_memmap_cacheattr_wt_allvalid = 0x11222222; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .vlpd.rodata : ALIGN(4) - { - _vlpd_rodata_start = ABSOLUTE(.); - *(.vlpd.rodata) - _vlpd_rodata_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.data : ALIGN(4) - { - _vlpd_data_start = ABSOLUTE(.); - *(.vlpd.data) - _vlpd_data_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _vlpd_bss_start = ABSOLUTE(.); - *(.vlpd.bss) - . = ALIGN (8); - _vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_old_vlpd_end = ALIGN(0x8); - } >old_vlpd_seg :old_vlpd_bss_phdr - - .efr_fr_hr_vlpd.rodata : ALIGN(4) - { - _efr_fr_hr_vlpd_rodata_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.rodata) - _efr_fr_hr_vlpd_rodata_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.data : ALIGN(4) - { - _efr_fr_hr_vlpd_data_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.data) - _efr_fr_hr_vlpd_data_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.bss) - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpd_end = ALIGN(0x8); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_bss_phdr - - .amr_vlpd.rodata : ALIGN(4) - { - _amr_vlpd_rodata_start = ABSOLUTE(.); - *(.amr_vlpd.rodata) - _amr_vlpd_rodata_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.data : ALIGN(4) - { - _amr_vlpd_data_start = ABSOLUTE(.); - *(.amr_vlpd.data) - _amr_vlpd_data_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amr_vlpd_bss_start = ABSOLUTE(.); - *(.amr_vlpd.bss) - . = ALIGN (8); - _amr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amr_vlpd_end = ALIGN(0x8); - } >amr_vlpd_seg :amr_vlpd_bss_phdr - - .amrwb_vlpd.rodata : ALIGN(4) - { - _amrwb_vlpd_rodata_start = ABSOLUTE(.); - *(.amrwb_vlpd.rodata) - _amrwb_vlpd_rodata_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.data : ALIGN(4) - { - _amrwb_vlpd_data_start = ABSOLUTE(.); - *(.amrwb_vlpd.data) - _amrwb_vlpd_data_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amrwb_vlpd_bss_start = ABSOLUTE(.); - *(.amrwb_vlpd.bss) - . = ALIGN (8); - _amrwb_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpd_end = ALIGN(0x8); - } >amrwb_vlpd_seg :amrwb_vlpd_bss_phdr - - .evrc_evrcb_vlpt.text : ALIGN(4) - { - _evrc_evrcb_vlpt_text_start = ABSOLUTE(.); - *(.evrc_evrcb_vlpt.literal .evrc_evrcb_vlpt.text) - _evrc_evrcb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_evrc_evrcb_vlpt_end = ALIGN(0x8); - } >evrc_evrcb_vlpt_seg :evrc_evrcb_vlpt_phdr - - .efr_fr_hr_vlpt.text : ALIGN(4) - { - _efr_fr_hr_vlpt_text_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpt.literal .efr_fr_hr_vlpt.text) - _efr_fr_hr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpt_end = ALIGN(0x8); - } >efr_fr_hr_vlpt_seg :efr_fr_hr_vlpt_phdr - - .amr_vlpt.text : ALIGN(4) - { - _amr_vlpt_text_start = ABSOLUTE(.); - *(.amr_vlpt.literal .amr_vlpt.text) - _amr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amr_vlpt_end = ALIGN(0x8); - } >amr_vlpt_seg :amr_vlpt_phdr - - .amrwb_vlpt.text : ALIGN(4) - { - _amrwb_vlpt_text_start = ABSOLUTE(.); - *(.amrwb_vlpt.literal .amrwb_vlpt.text) - _amrwb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpt_end = ALIGN(0x8); - } >amrwb_vlpt_seg :amrwb_vlpt_phdr - - .vlpt.text : ALIGN(4) - { - _vlpt_text_start = ABSOLUTE(.); - *(.vlpt.literal .vlpt.text) - _vlpt_text_end = ABSOLUTE(.); - _memmap_seg_vlpt_end = ALIGN(0x8); - } >vlpt_seg :vlpt_phdr - - .low_power_dyn_alloc : ALIGN(4) - { - _low_power_dyn_alloc_start = ABSOLUTE(.); - *(.low_power_dyn_alloc) - _low_power_dyn_alloc_end = ABSOLUTE(.); - _memmap_seg_vlpd_end = ALIGN(0x8); - } >vlpd_seg :vlpd_phdr - - .ulpp.rodata : ALIGN(4) - { - _ulpp_rodata_start = ABSOLUTE(.); - *(.ulpp.rodata) - _ulpp_rodata_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.data : ALIGN(4) - { - _ulpp_data_start = ABSOLUTE(.); - *(.ulpp.data) - _ulpp_data_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.text : ALIGN(4) - { - _ulpp_text_start = ABSOLUTE(.); - *(.ulpp.literal .ulpp.text) - _ulpp_text_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _ulpp_bss_start = ABSOLUTE(.); - *(.ulpp.bss) - . = ALIGN (8); - _ulpp_bss_end = ABSOLUTE(.); - _memmap_seg_ulpp_end = ALIGN(0x8); - } >ulpp_seg :ulpp_bss_phdr - - .dtsv3.rodata : ALIGN(4) - { - _dtsv3_rodata_start = ABSOLUTE(.); - *(.dtsv3.rodata) - _dtsv3_rodata_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.data : ALIGN(4) - { - _dtsv3_data_start = ABSOLUTE(.); - *(.dtsv3.data) - _dtsv3_data_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.text : ALIGN(4) - { - _dtsv3_text_start = ABSOLUTE(.); - *(.dtsv3.literal .dtsv3.text) - _dtsv3_text_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv3_bss_start = ABSOLUTE(.); - *(.dtsv3.bss) - . = ALIGN (8); - _dtsv3_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv3_end = ALIGN(0x8); - } >dtsv3_seg :dtsv3_bss_phdr - - .dtsv4.rodata : ALIGN(4) - { - _dtsv4_rodata_start = ABSOLUTE(.); - *(.dtsv4.rodata) - _dtsv4_rodata_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.data : ALIGN(4) - { - _dtsv4_data_start = ABSOLUTE(.); - *(.dtsv4.data) - _dtsv4_data_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.text : ALIGN(4) - { - _dtsv4_text_start = ABSOLUTE(.); - *(.dtsv4.literal .dtsv4.text) - _dtsv4_text_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv4_bss_start = ABSOLUTE(.); - *(.dtsv4.bss) - . = ALIGN (8); - _dtsv4_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv4_end = ALIGN(0x8); - } >dtsv4_seg :dtsv4_bss_phdr - - .dram0.rodata : ALIGN(4) - { - _dram0_rodata_start = ABSOLUTE(.); - *(.dram0.rodata) - *(.dram.rodata) - _dram0_rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.literal : ALIGN(4) - { - _dram0_literal_start = ABSOLUTE(.); - *(.dram0.literal) - *(.dram.literal) - _dram0_literal_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.data : ALIGN(4) - { - _dram0_data_start = ABSOLUTE(.); - *(.dram0.data) - *(.dram.data) - _dram0_data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dram0_bss_start = ABSOLUTE(.); - *(.dram0.bss) - *(.om.debug.bss) - *(.os.stack.bss) - . = ALIGN (8); - _dram0_bss_end = ABSOLUTE(.); - _end = ALIGN(0x8); - PROVIDE(end = ALIGN(0x8)); - _stack_sentry = ALIGN(0x8); - _memmap_seg_dram0_0_end = ALIGN(0x8); - } >dram0_0_seg :dram0_0_bss_phdr - __stack = 0xe8080000; - _heap_sentry = 0xe8080000; - - .ResetVector.text : ALIGN(4) - { - _ResetVector_text_start = ABSOLUTE(.); - KEEP (*(.ResetVector.text)) - _ResetVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_0_end = ALIGN(0x8); - } >iram0_0_seg :iram0_0_phdr - - .Reset.literal : ALIGN(4) - { - _Reset_literal_start = ABSOLUTE(.); - *(.Reset.literal) - _Reset_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_1_end = ALIGN(0x8); - } >iram0_1_seg :iram0_1_phdr - - .WindowVectors.text : ALIGN(4) - { - _WindowVectors_text_start = ABSOLUTE(.); - KEEP (*(.WindowVectors.text)) - _WindowVectors_text_end = ABSOLUTE(.); - _memmap_seg_iram0_2_end = ALIGN(0x8); - } >iram0_2_seg :iram0_2_phdr - - .Level2InterruptVector.literal : ALIGN(4) - { - _Level2InterruptVector_literal_start = ABSOLUTE(.); - *(.Level2InterruptVector.literal) - _Level2InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_3_end = ALIGN(0x8); - } >iram0_3_seg :iram0_3_phdr - - .Level2InterruptVector.text : ALIGN(4) - { - _Level2InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level2InterruptVector.text)) - _Level2InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_4_end = ALIGN(0x8); - } >iram0_4_seg :iram0_4_phdr - - .Level3InterruptVector.literal : ALIGN(4) - { - _Level3InterruptVector_literal_start = ABSOLUTE(.); - *(.Level3InterruptVector.literal) - _Level3InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_5_end = ALIGN(0x8); - } >iram0_5_seg :iram0_5_phdr - - .Level3InterruptVector.text : ALIGN(4) - { - _Level3InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level3InterruptVector.text)) - _Level3InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_6_end = ALIGN(0x8); - } >iram0_6_seg :iram0_6_phdr - - .Level4InterruptVector.literal : ALIGN(4) - { - _Level4InterruptVector_literal_start = ABSOLUTE(.); - *(.Level4InterruptVector.literal) - _Level4InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_7_end = ALIGN(0x8); - } >iram0_7_seg :iram0_7_phdr - - .Level4InterruptVector.text : ALIGN(4) - { - _Level4InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level4InterruptVector.text)) - _Level4InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_8_end = ALIGN(0x8); - } >iram0_8_seg :iram0_8_phdr - - .DebugExceptionVector.literal : ALIGN(4) - { - _DebugExceptionVector_literal_start = ABSOLUTE(.); - *(.DebugExceptionVector.literal) - _DebugExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_9_end = ALIGN(0x8); - } >iram0_9_seg :iram0_9_phdr - - .DebugExceptionVector.text : ALIGN(4) - { - _DebugExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DebugExceptionVector.text)) - _DebugExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_10_end = ALIGN(0x8); - } >iram0_10_seg :iram0_10_phdr - - .NMIExceptionVector.literal : ALIGN(4) - { - _NMIExceptionVector_literal_start = ABSOLUTE(.); - *(.NMIExceptionVector.literal) - _NMIExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_11_end = ALIGN(0x8); - } >iram0_11_seg :iram0_11_phdr - - .NMIExceptionVector.text : ALIGN(4) - { - _NMIExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.NMIExceptionVector.text)) - _NMIExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_12_end = ALIGN(0x8); - } >iram0_12_seg :iram0_12_phdr - - .KernelExceptionVector.literal : ALIGN(4) - { - _KernelExceptionVector_literal_start = ABSOLUTE(.); - *(.KernelExceptionVector.literal) - _KernelExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_13_end = ALIGN(0x8); - } >iram0_13_seg :iram0_13_phdr - - .KernelExceptionVector.text : ALIGN(4) - { - _KernelExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.KernelExceptionVector.text)) - _KernelExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_14_end = ALIGN(0x8); - } >iram0_14_seg :iram0_14_phdr - - .UserExceptionVector.literal : ALIGN(4) - { - _UserExceptionVector_literal_start = ABSOLUTE(.); - *(.UserExceptionVector.literal) - _UserExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_15_end = ALIGN(0x8); - } >iram0_15_seg :iram0_15_phdr - - .UserExceptionVector.text : ALIGN(4) - { - _UserExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.UserExceptionVector.text)) - _UserExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_16_end = ALIGN(0x8); - } >iram0_16_seg :iram0_16_phdr - - .DoubleExceptionVector.literal : ALIGN(4) - { - _DoubleExceptionVector_literal_start = ABSOLUTE(.); - *(.DoubleExceptionVector.literal) - _DoubleExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_17_end = ALIGN(0x8); - } >iram0_17_seg :iram0_17_phdr - - .DoubleExceptionVector.text : ALIGN(4) - { - _DoubleExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DoubleExceptionVector.text)) - _DoubleExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_18_end = ALIGN(0x8); - } >iram0_18_seg :iram0_18_phdr - - .Reset.text : ALIGN(4) - { - _Reset_text_start = ABSOLUTE(.); - *(.Reset.text) - _Reset_text_end = ABSOLUTE(.); - } >iram0_19_seg :iram0_19_phdr - - .iram0.text : ALIGN(4) - { - _iram0_text_start = ABSOLUTE(.); - *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text) - _iram0_text_end = ABSOLUTE(.); - _memmap_seg_iram0_19_end = ALIGN(0x8); - } >iram0_19_seg :iram0_19_phdr - - .sram.shareaddr : ALIGN(4) - { - _sram_shareaddr_start = ABSOLUTE(.); - *(.sram.shareaddr) - _sram_shareaddr_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.rodata : ALIGN(4) - { - _sram_rodata_start = ABSOLUTE(.); - *(.sram.rodata) - _sram_rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - KEEP (*(.xt_except_table)) - KEEP (*(.gcc_except_table)) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - KEEP (*(.eh_frame)) - /* C++ constructor and destructor tables, properly ordered: */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_vlpd_bss_start) - LONG(_vlpd_bss_end) - LONG(_efr_fr_hr_vlpd_bss_start) - LONG(_efr_fr_hr_vlpd_bss_end) - LONG(_amr_vlpd_bss_start) - LONG(_amr_vlpd_bss_end) - LONG(_amrwb_vlpd_bss_start) - LONG(_amrwb_vlpd_bss_end) - LONG(_ulpp_bss_start) - LONG(_ulpp_bss_end) - LONG(_dtsv3_bss_start) - LONG(_dtsv3_bss_end) - LONG(_dtsv4_bss_start) - LONG(_dtsv4_bss_end) - LONG(_dram0_bss_start) - LONG(_dram0_bss_end) - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.text : ALIGN(4) - { - _sram_text_start = ABSOLUTE(.); - *(.sram.literal .sram.text) - _sram_text_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.entry.text) - *(.init.literal) - KEEP(*(.init)) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - KEEP(*(.fini)) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >sram0_seg :sram0_phdr - - .sram.data : ALIGN(4) - { - _sram_data_start = ABSOLUTE(.); - *(.sram.data) - _sram_data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - KEEP(*(.gnu.linkonce.d.*personality*)) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - KEEP(*(.jcr)) - _data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.uninit : ALIGN(4) - { - _sram_uninit_start = ABSOLUTE(.); - *(.sram.uninit) - _sram_uninit_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - *(.sram.pool.bss) - *(.sram.bss) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _memmap_seg_sram0_end = ALIGN(0x8); - } >sram0_seg :sram0_bss_phdr - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .xt.insn 0 : - { - KEEP (*(.xt.insn)) - KEEP (*(.gnu.linkonce.x.*)) - } - .xt.prop 0 : - { - KEEP (*(.xt.prop)) - KEEP (*(.xt.prop.*)) - KEEP (*(.gnu.linkonce.prop.*)) - } - .xt.lit 0 : - { - KEEP (*(.xt.lit)) - KEEP (*(.xt.lit.*)) - KEEP (*(.gnu.linkonce.p.*)) - } - .debug.xt.callgraph 0 : - { - KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) - } -} - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xn b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xn deleted file mode 100644 index 17c05e16..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xn +++ /dev/null @@ -1,827 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP hifi_hikey_lsp */ -/* Linker Script for ld -n */ -MEMORY -{ - sram0_seg : org = 0xC0000000, len = 0x408000 - old_vlpd_seg : org = 0xC0408000, len = 0x10000 - efr_fr_hr_vlpd_seg : org = 0xC0418000, len = 0x10000 - amr_vlpd_seg : org = 0xC0428000, len = 0x10000 - amrwb_vlpd_seg : org = 0xC0438000, len = 0x10000 - evrc_evrcb_vlpt_seg : org = 0xC0448000, len = 0x48000 - efr_fr_hr_vlpt_seg : org = 0xC0490000, len = 0x30000 - amr_vlpt_seg : org = 0xC04C0000, len = 0x20000 - amrwb_vlpt_seg : org = 0xC04E0000, len = 0x30000 - vlpt_seg : org = 0xC0510000, len = 0x48000 - vlpd_seg : org = 0xC0558000, len = 0x20000 - ulpp_seg : org = 0xC0578000, len = 0x40000 - dtsv3_seg : org = 0xC05B8000, len = 0x20000 - dtsv4_seg : org = 0xC05D8000, len = 0x28000 - dram0_0_seg : org = 0xE8058000, len = 0x28000 - iram0_0_seg : org = 0xE8080000, len = 0x300 - iram0_1_seg : org = 0xE8080300, len = 0x100 - iram0_2_seg : org = 0xE8080400, len = 0x178 - iram0_3_seg : org = 0xE8080578, len = 0x8 - iram0_4_seg : org = 0xE8080580, len = 0x38 - iram0_5_seg : org = 0xE80805B8, len = 0x8 - iram0_6_seg : org = 0xE80805C0, len = 0x38 - iram0_7_seg : org = 0xE80805F8, len = 0x8 - iram0_8_seg : org = 0xE8080600, len = 0x38 - iram0_9_seg : org = 0xE8080638, len = 0x8 - iram0_10_seg : org = 0xE8080640, len = 0x38 - iram0_11_seg : org = 0xE8080678, len = 0x48 - iram0_12_seg : org = 0xE80806C0, len = 0x38 - iram0_13_seg : org = 0xE80806F8, len = 0x8 - iram0_14_seg : org = 0xE8080700, len = 0x38 - iram0_15_seg : org = 0xE8080738, len = 0x8 - iram0_16_seg : org = 0xE8080740, len = 0x38 - iram0_17_seg : org = 0xE8080778, len = 0x48 - iram0_18_seg : org = 0xE80807C0, len = 0x40 - iram0_19_seg : org = 0xE8080800, len = 0xB800 -} - -PHDRS -{ - sram0_phdr PT_LOAD; - sram0_bss_phdr PT_LOAD; - old_vlpd_phdr PT_LOAD; - old_vlpd_bss_phdr PT_LOAD; - efr_fr_hr_vlpd_phdr PT_LOAD; - efr_fr_hr_vlpd_bss_phdr PT_LOAD; - amr_vlpd_phdr PT_LOAD; - amr_vlpd_bss_phdr PT_LOAD; - amrwb_vlpd_phdr PT_LOAD; - amrwb_vlpd_bss_phdr PT_LOAD; - evrc_evrcb_vlpt_phdr PT_LOAD; - efr_fr_hr_vlpt_phdr PT_LOAD; - amr_vlpt_phdr PT_LOAD; - amrwb_vlpt_phdr PT_LOAD; - vlpt_phdr PT_LOAD; - vlpd_phdr PT_LOAD; - ulpp_phdr PT_LOAD; - ulpp_bss_phdr PT_LOAD; - dtsv3_phdr PT_LOAD; - dtsv3_bss_phdr PT_LOAD; - dtsv4_phdr PT_LOAD; - dtsv4_bss_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram0_0_phdr PT_LOAD; - iram0_1_phdr PT_LOAD; - iram0_2_phdr PT_LOAD; - iram0_3_phdr PT_LOAD; - iram0_4_phdr PT_LOAD; - iram0_5_phdr PT_LOAD; - iram0_6_phdr PT_LOAD; - iram0_7_phdr PT_LOAD; - iram0_8_phdr PT_LOAD; - iram0_9_phdr PT_LOAD; - iram0_10_phdr PT_LOAD; - iram0_11_phdr PT_LOAD; - iram0_12_phdr PT_LOAD; - iram0_13_phdr PT_LOAD; - iram0_14_phdr PT_LOAD; - iram0_15_phdr PT_LOAD; - iram0_16_phdr PT_LOAD; - iram0_17_phdr PT_LOAD; - iram0_18_phdr PT_LOAD; - iram0_19_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(_ResetVector) - -/* Memory boundary addresses: */ -_memmap_mem_iram0_start = 0xe8080000; -_memmap_mem_iram0_end = 0xe808c000; -_memmap_mem_dram0_start = 0xe8058000; -_memmap_mem_dram0_end = 0xe8080000; -_memmap_mem_sram_start = 0xc0000000; -_memmap_mem_sram_end = 0xc0600000; - -/* Memory segment boundary addresses: */ -_memmap_seg_sram0_start = 0xc0000000; -_memmap_seg_sram0_max = 0xc0408000; -_memmap_seg_old_vlpd_start = 0xc0408000; -_memmap_seg_old_vlpd_max = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_start = 0xc0418000; -_memmap_seg_efr_fr_hr_vlpd_max = 0xc0428000; -_memmap_seg_amr_vlpd_start = 0xc0428000; -_memmap_seg_amr_vlpd_max = 0xc0438000; -_memmap_seg_amrwb_vlpd_start = 0xc0438000; -_memmap_seg_amrwb_vlpd_max = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_start = 0xc0448000; -_memmap_seg_evrc_evrcb_vlpt_max = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_start = 0xc0490000; -_memmap_seg_efr_fr_hr_vlpt_max = 0xc04c0000; -_memmap_seg_amr_vlpt_start = 0xc04c0000; -_memmap_seg_amr_vlpt_max = 0xc04e0000; -_memmap_seg_amrwb_vlpt_start = 0xc04e0000; -_memmap_seg_amrwb_vlpt_max = 0xc0510000; -_memmap_seg_vlpt_start = 0xc0510000; -_memmap_seg_vlpt_max = 0xc0558000; -_memmap_seg_vlpd_start = 0xc0558000; -_memmap_seg_vlpd_max = 0xc0578000; -_memmap_seg_ulpp_start = 0xc0578000; -_memmap_seg_ulpp_max = 0xc05b8000; -_memmap_seg_dtsv3_start = 0xc05b8000; -_memmap_seg_dtsv3_max = 0xc05d8000; -_memmap_seg_dtsv4_start = 0xc05d8000; -_memmap_seg_dtsv4_max = 0xc0600000; -_memmap_seg_dram0_0_start = 0xe8058000; -_memmap_seg_dram0_0_max = 0xe8080000; -_memmap_seg_iram0_0_start = 0xe8080000; -_memmap_seg_iram0_0_max = 0xe8080300; -_memmap_seg_iram0_1_start = 0xe8080300; -_memmap_seg_iram0_1_max = 0xe8080400; -_memmap_seg_iram0_2_start = 0xe8080400; -_memmap_seg_iram0_2_max = 0xe8080578; -_memmap_seg_iram0_3_start = 0xe8080578; -_memmap_seg_iram0_3_max = 0xe8080580; -_memmap_seg_iram0_4_start = 0xe8080580; -_memmap_seg_iram0_4_max = 0xe80805b8; -_memmap_seg_iram0_5_start = 0xe80805b8; -_memmap_seg_iram0_5_max = 0xe80805c0; -_memmap_seg_iram0_6_start = 0xe80805c0; -_memmap_seg_iram0_6_max = 0xe80805f8; -_memmap_seg_iram0_7_start = 0xe80805f8; -_memmap_seg_iram0_7_max = 0xe8080600; -_memmap_seg_iram0_8_start = 0xe8080600; -_memmap_seg_iram0_8_max = 0xe8080638; -_memmap_seg_iram0_9_start = 0xe8080638; -_memmap_seg_iram0_9_max = 0xe8080640; -_memmap_seg_iram0_10_start = 0xe8080640; -_memmap_seg_iram0_10_max = 0xe8080678; -_memmap_seg_iram0_11_start = 0xe8080678; -_memmap_seg_iram0_11_max = 0xe80806c0; -_memmap_seg_iram0_12_start = 0xe80806c0; -_memmap_seg_iram0_12_max = 0xe80806f8; -_memmap_seg_iram0_13_start = 0xe80806f8; -_memmap_seg_iram0_13_max = 0xe8080700; -_memmap_seg_iram0_14_start = 0xe8080700; -_memmap_seg_iram0_14_max = 0xe8080738; -_memmap_seg_iram0_15_start = 0xe8080738; -_memmap_seg_iram0_15_max = 0xe8080740; -_memmap_seg_iram0_16_start = 0xe8080740; -_memmap_seg_iram0_16_max = 0xe8080778; -_memmap_seg_iram0_17_start = 0xe8080778; -_memmap_seg_iram0_17_max = 0xe80807c0; -_memmap_seg_iram0_18_start = 0xe80807c0; -_memmap_seg_iram0_18_max = 0xe8080800; -_memmap_seg_iram0_19_start = 0xe8080800; -_memmap_seg_iram0_19_max = 0xe808c000; - -_rom_store_table = 0; -PROVIDE(_memmap_vecbase_reset = 0xe8080400); -PROVIDE(_memmap_reset_vector = 0xe8080000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x44000000; -_memmap_cacheattr_wt_base = 0x11000000; -_memmap_cacheattr_bp_base = 0x22000000; -_memmap_cacheattr_unused_mask = 0x00FFFFFF; -_memmap_cacheattr_wb_trapnull = 0x4422222F; -_memmap_cacheattr_wba_trapnull = 0x4422222F; -_memmap_cacheattr_wbna_trapnull = 0x5522222F; -_memmap_cacheattr_wt_trapnull = 0x1122222F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0x44FFFFFF; -_memmap_cacheattr_wt_strict = 0x11FFFFFF; -_memmap_cacheattr_bp_strict = 0x22FFFFFF; -_memmap_cacheattr_wb_allvalid = 0x44222222; -_memmap_cacheattr_wt_allvalid = 0x11222222; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .vlpd.rodata : ALIGN(4) - { - _vlpd_rodata_start = ABSOLUTE(.); - *(.vlpd.rodata) - _vlpd_rodata_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.data : ALIGN(4) - { - _vlpd_data_start = ABSOLUTE(.); - *(.vlpd.data) - _vlpd_data_end = ABSOLUTE(.); - } >old_vlpd_seg :old_vlpd_phdr - - .vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _vlpd_bss_start = ABSOLUTE(.); - *(.vlpd.bss) - . = ALIGN (8); - _vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_old_vlpd_end = ALIGN(0x8); - } >old_vlpd_seg :old_vlpd_bss_phdr - - .efr_fr_hr_vlpd.rodata : ALIGN(4) - { - _efr_fr_hr_vlpd_rodata_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.rodata) - _efr_fr_hr_vlpd_rodata_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.data : ALIGN(4) - { - _efr_fr_hr_vlpd_data_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.data) - _efr_fr_hr_vlpd_data_end = ABSOLUTE(.); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_phdr - - .efr_fr_hr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpd.bss) - . = ALIGN (8); - _efr_fr_hr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpd_end = ALIGN(0x8); - } >efr_fr_hr_vlpd_seg :efr_fr_hr_vlpd_bss_phdr - - .amr_vlpd.rodata : ALIGN(4) - { - _amr_vlpd_rodata_start = ABSOLUTE(.); - *(.amr_vlpd.rodata) - _amr_vlpd_rodata_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.data : ALIGN(4) - { - _amr_vlpd_data_start = ABSOLUTE(.); - *(.amr_vlpd.data) - _amr_vlpd_data_end = ABSOLUTE(.); - } >amr_vlpd_seg :amr_vlpd_phdr - - .amr_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amr_vlpd_bss_start = ABSOLUTE(.); - *(.amr_vlpd.bss) - . = ALIGN (8); - _amr_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amr_vlpd_end = ALIGN(0x8); - } >amr_vlpd_seg :amr_vlpd_bss_phdr - - .amrwb_vlpd.rodata : ALIGN(4) - { - _amrwb_vlpd_rodata_start = ABSOLUTE(.); - *(.amrwb_vlpd.rodata) - _amrwb_vlpd_rodata_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.data : ALIGN(4) - { - _amrwb_vlpd_data_start = ABSOLUTE(.); - *(.amrwb_vlpd.data) - _amrwb_vlpd_data_end = ABSOLUTE(.); - } >amrwb_vlpd_seg :amrwb_vlpd_phdr - - .amrwb_vlpd.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _amrwb_vlpd_bss_start = ABSOLUTE(.); - *(.amrwb_vlpd.bss) - . = ALIGN (8); - _amrwb_vlpd_bss_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpd_end = ALIGN(0x8); - } >amrwb_vlpd_seg :amrwb_vlpd_bss_phdr - - .evrc_evrcb_vlpt.text : ALIGN(4) - { - _evrc_evrcb_vlpt_text_start = ABSOLUTE(.); - *(.evrc_evrcb_vlpt.literal .evrc_evrcb_vlpt.text) - _evrc_evrcb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_evrc_evrcb_vlpt_end = ALIGN(0x8); - } >evrc_evrcb_vlpt_seg :evrc_evrcb_vlpt_phdr - - .efr_fr_hr_vlpt.text : ALIGN(4) - { - _efr_fr_hr_vlpt_text_start = ABSOLUTE(.); - *(.efr_fr_hr_vlpt.literal .efr_fr_hr_vlpt.text) - _efr_fr_hr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_efr_fr_hr_vlpt_end = ALIGN(0x8); - } >efr_fr_hr_vlpt_seg :efr_fr_hr_vlpt_phdr - - .amr_vlpt.text : ALIGN(4) - { - _amr_vlpt_text_start = ABSOLUTE(.); - *(.amr_vlpt.literal .amr_vlpt.text) - _amr_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amr_vlpt_end = ALIGN(0x8); - } >amr_vlpt_seg :amr_vlpt_phdr - - .amrwb_vlpt.text : ALIGN(4) - { - _amrwb_vlpt_text_start = ABSOLUTE(.); - *(.amrwb_vlpt.literal .amrwb_vlpt.text) - _amrwb_vlpt_text_end = ABSOLUTE(.); - _memmap_seg_amrwb_vlpt_end = ALIGN(0x8); - } >amrwb_vlpt_seg :amrwb_vlpt_phdr - - .vlpt.text : ALIGN(4) - { - _vlpt_text_start = ABSOLUTE(.); - *(.vlpt.literal .vlpt.text) - _vlpt_text_end = ABSOLUTE(.); - _memmap_seg_vlpt_end = ALIGN(0x8); - } >vlpt_seg :vlpt_phdr - - .low_power_dyn_alloc : ALIGN(4) - { - _low_power_dyn_alloc_start = ABSOLUTE(.); - *(.low_power_dyn_alloc) - _low_power_dyn_alloc_end = ABSOLUTE(.); - _memmap_seg_vlpd_end = ALIGN(0x8); - } >vlpd_seg :vlpd_phdr - - .ulpp.rodata : ALIGN(4) - { - _ulpp_rodata_start = ABSOLUTE(.); - *(.ulpp.rodata) - _ulpp_rodata_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.data : ALIGN(4) - { - _ulpp_data_start = ABSOLUTE(.); - *(.ulpp.data) - _ulpp_data_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.text : ALIGN(4) - { - _ulpp_text_start = ABSOLUTE(.); - *(.ulpp.literal .ulpp.text) - _ulpp_text_end = ABSOLUTE(.); - } >ulpp_seg :ulpp_phdr - - .ulpp.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _ulpp_bss_start = ABSOLUTE(.); - *(.ulpp.bss) - . = ALIGN (8); - _ulpp_bss_end = ABSOLUTE(.); - _memmap_seg_ulpp_end = ALIGN(0x8); - } >ulpp_seg :ulpp_bss_phdr - - .dtsv3.rodata : ALIGN(4) - { - _dtsv3_rodata_start = ABSOLUTE(.); - *(.dtsv3.rodata) - _dtsv3_rodata_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.data : ALIGN(4) - { - _dtsv3_data_start = ABSOLUTE(.); - *(.dtsv3.data) - _dtsv3_data_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.text : ALIGN(4) - { - _dtsv3_text_start = ABSOLUTE(.); - *(.dtsv3.literal .dtsv3.text) - _dtsv3_text_end = ABSOLUTE(.); - } >dtsv3_seg :dtsv3_phdr - - .dtsv3.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv3_bss_start = ABSOLUTE(.); - *(.dtsv3.bss) - . = ALIGN (8); - _dtsv3_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv3_end = ALIGN(0x8); - } >dtsv3_seg :dtsv3_bss_phdr - - .dtsv4.rodata : ALIGN(4) - { - _dtsv4_rodata_start = ABSOLUTE(.); - *(.dtsv4.rodata) - _dtsv4_rodata_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.data : ALIGN(4) - { - _dtsv4_data_start = ABSOLUTE(.); - *(.dtsv4.data) - _dtsv4_data_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.text : ALIGN(4) - { - _dtsv4_text_start = ABSOLUTE(.); - *(.dtsv4.literal .dtsv4.text) - _dtsv4_text_end = ABSOLUTE(.); - } >dtsv4_seg :dtsv4_phdr - - .dtsv4.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dtsv4_bss_start = ABSOLUTE(.); - *(.dtsv4.bss) - . = ALIGN (8); - _dtsv4_bss_end = ABSOLUTE(.); - _memmap_seg_dtsv4_end = ALIGN(0x8); - } >dtsv4_seg :dtsv4_bss_phdr - - .dram0.rodata : ALIGN(4) - { - _dram0_rodata_start = ABSOLUTE(.); - *(.dram0.rodata) - *(.dram.rodata) - _dram0_rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.literal : ALIGN(4) - { - _dram0_literal_start = ABSOLUTE(.); - *(.dram0.literal) - *(.dram.literal) - _dram0_literal_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.data : ALIGN(4) - { - _dram0_data_start = ABSOLUTE(.); - *(.dram0.data) - *(.dram.data) - _dram0_data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .dram0.bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _dram0_bss_start = ABSOLUTE(.); - *(.dram0.bss) - *(.om.debug.bss) - *(.os.stack.bss) - . = ALIGN (8); - _dram0_bss_end = ABSOLUTE(.); - _end = ALIGN(0x8); - PROVIDE(end = ALIGN(0x8)); - _stack_sentry = ALIGN(0x8); - _memmap_seg_dram0_0_end = ALIGN(0x8); - } >dram0_0_seg :dram0_0_bss_phdr - __stack = 0xe8080000; - _heap_sentry = 0xe8080000; - - .ResetVector.text : ALIGN(4) - { - _ResetVector_text_start = ABSOLUTE(.); - KEEP (*(.ResetVector.text)) - _ResetVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_0_end = ALIGN(0x8); - } >iram0_0_seg :iram0_0_phdr - - .Reset.literal : ALIGN(4) - { - _Reset_literal_start = ABSOLUTE(.); - *(.Reset.literal) - _Reset_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_1_end = ALIGN(0x8); - } >iram0_1_seg :iram0_1_phdr - - .WindowVectors.text : ALIGN(4) - { - _WindowVectors_text_start = ABSOLUTE(.); - KEEP (*(.WindowVectors.text)) - _WindowVectors_text_end = ABSOLUTE(.); - _memmap_seg_iram0_2_end = ALIGN(0x8); - } >iram0_2_seg :iram0_2_phdr - - .Level2InterruptVector.literal : ALIGN(4) - { - _Level2InterruptVector_literal_start = ABSOLUTE(.); - *(.Level2InterruptVector.literal) - _Level2InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_3_end = ALIGN(0x8); - } >iram0_3_seg :iram0_3_phdr - - .Level2InterruptVector.text : ALIGN(4) - { - _Level2InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level2InterruptVector.text)) - _Level2InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_4_end = ALIGN(0x8); - } >iram0_4_seg :iram0_4_phdr - - .Level3InterruptVector.literal : ALIGN(4) - { - _Level3InterruptVector_literal_start = ABSOLUTE(.); - *(.Level3InterruptVector.literal) - _Level3InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_5_end = ALIGN(0x8); - } >iram0_5_seg :iram0_5_phdr - - .Level3InterruptVector.text : ALIGN(4) - { - _Level3InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level3InterruptVector.text)) - _Level3InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_6_end = ALIGN(0x8); - } >iram0_6_seg :iram0_6_phdr - - .Level4InterruptVector.literal : ALIGN(4) - { - _Level4InterruptVector_literal_start = ABSOLUTE(.); - *(.Level4InterruptVector.literal) - _Level4InterruptVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_7_end = ALIGN(0x8); - } >iram0_7_seg :iram0_7_phdr - - .Level4InterruptVector.text : ALIGN(4) - { - _Level4InterruptVector_text_start = ABSOLUTE(.); - KEEP (*(.Level4InterruptVector.text)) - _Level4InterruptVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_8_end = ALIGN(0x8); - } >iram0_8_seg :iram0_8_phdr - - .DebugExceptionVector.literal : ALIGN(4) - { - _DebugExceptionVector_literal_start = ABSOLUTE(.); - *(.DebugExceptionVector.literal) - _DebugExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_9_end = ALIGN(0x8); - } >iram0_9_seg :iram0_9_phdr - - .DebugExceptionVector.text : ALIGN(4) - { - _DebugExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DebugExceptionVector.text)) - _DebugExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_10_end = ALIGN(0x8); - } >iram0_10_seg :iram0_10_phdr - - .NMIExceptionVector.literal : ALIGN(4) - { - _NMIExceptionVector_literal_start = ABSOLUTE(.); - *(.NMIExceptionVector.literal) - _NMIExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_11_end = ALIGN(0x8); - } >iram0_11_seg :iram0_11_phdr - - .NMIExceptionVector.text : ALIGN(4) - { - _NMIExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.NMIExceptionVector.text)) - _NMIExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_12_end = ALIGN(0x8); - } >iram0_12_seg :iram0_12_phdr - - .KernelExceptionVector.literal : ALIGN(4) - { - _KernelExceptionVector_literal_start = ABSOLUTE(.); - *(.KernelExceptionVector.literal) - _KernelExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_13_end = ALIGN(0x8); - } >iram0_13_seg :iram0_13_phdr - - .KernelExceptionVector.text : ALIGN(4) - { - _KernelExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.KernelExceptionVector.text)) - _KernelExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_14_end = ALIGN(0x8); - } >iram0_14_seg :iram0_14_phdr - - .UserExceptionVector.literal : ALIGN(4) - { - _UserExceptionVector_literal_start = ABSOLUTE(.); - *(.UserExceptionVector.literal) - _UserExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_15_end = ALIGN(0x8); - } >iram0_15_seg :iram0_15_phdr - - .UserExceptionVector.text : ALIGN(4) - { - _UserExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.UserExceptionVector.text)) - _UserExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_16_end = ALIGN(0x8); - } >iram0_16_seg :iram0_16_phdr - - .DoubleExceptionVector.literal : ALIGN(4) - { - _DoubleExceptionVector_literal_start = ABSOLUTE(.); - *(.DoubleExceptionVector.literal) - _DoubleExceptionVector_literal_end = ABSOLUTE(.); - _memmap_seg_iram0_17_end = ALIGN(0x8); - } >iram0_17_seg :iram0_17_phdr - - .DoubleExceptionVector.text : ALIGN(4) - { - _DoubleExceptionVector_text_start = ABSOLUTE(.); - KEEP (*(.DoubleExceptionVector.text)) - _DoubleExceptionVector_text_end = ABSOLUTE(.); - _memmap_seg_iram0_18_end = ALIGN(0x8); - } >iram0_18_seg :iram0_18_phdr - - .Reset.text : ALIGN(4) - { - _Reset_text_start = ABSOLUTE(.); - *(.Reset.text) - _Reset_text_end = ABSOLUTE(.); - } >iram0_19_seg :iram0_19_phdr - - .iram0.text : ALIGN(4) - { - _iram0_text_start = ABSOLUTE(.); - *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text) - _iram0_text_end = ABSOLUTE(.); - _memmap_seg_iram0_19_end = ALIGN(0x8); - } >iram0_19_seg :iram0_19_phdr - - .sram.shareaddr : ALIGN(4) - { - _sram_shareaddr_start = ABSOLUTE(.); - *(.sram.shareaddr) - _sram_shareaddr_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.rodata : ALIGN(4) - { - _sram_rodata_start = ABSOLUTE(.); - *(.sram.rodata) - _sram_rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - KEEP (*(.xt_except_table)) - KEEP (*(.gcc_except_table)) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - KEEP (*(.eh_frame)) - /* C++ constructor and destructor tables, properly ordered: */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_vlpd_bss_start) - LONG(_vlpd_bss_end) - LONG(_efr_fr_hr_vlpd_bss_start) - LONG(_efr_fr_hr_vlpd_bss_end) - LONG(_amr_vlpd_bss_start) - LONG(_amr_vlpd_bss_end) - LONG(_amrwb_vlpd_bss_start) - LONG(_amrwb_vlpd_bss_end) - LONG(_ulpp_bss_start) - LONG(_ulpp_bss_end) - LONG(_dtsv3_bss_start) - LONG(_dtsv3_bss_end) - LONG(_dtsv4_bss_start) - LONG(_dtsv4_bss_end) - LONG(_dram0_bss_start) - LONG(_dram0_bss_end) - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.text : ALIGN(4) - { - _sram_text_start = ABSOLUTE(.); - *(.sram.literal .sram.text) - _sram_text_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.entry.text) - *(.init.literal) - KEEP(*(.init)) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - KEEP(*(.fini)) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >sram0_seg :sram0_phdr - - .sram.data : ALIGN(4) - { - _sram_data_start = ABSOLUTE(.); - *(.sram.data) - _sram_data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - KEEP(*(.gnu.linkonce.d.*personality*)) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - KEEP(*(.jcr)) - _data_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .sram.uninit : ALIGN(4) - { - _sram_uninit_start = ABSOLUTE(.); - *(.sram.uninit) - _sram_uninit_end = ABSOLUTE(.); - } >sram0_seg :sram0_phdr - - .bss (NOLOAD) : ALIGN(8) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - *(.sram.pool.bss) - *(.sram.bss) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _memmap_seg_sram0_end = ALIGN(0x8); - } >sram0_seg :sram0_bss_phdr - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .xt.insn 0 : - { - KEEP (*(.xt.insn)) - KEEP (*(.gnu.linkonce.x.*)) - } - .xt.prop 0 : - { - KEEP (*(.xt.prop)) - KEEP (*(.xt.prop.*)) - KEEP (*(.gnu.linkonce.prop.*)) - } - .xt.lit 0 : - { - KEEP (*(.xt.lit)) - KEEP (*(.xt.lit.*)) - KEEP (*(.gnu.linkonce.p.*)) - } - .debug.xt.callgraph 0 : - { - KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) - } -} - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xr b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xr deleted file mode 100644 index 3e9f189a..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xr +++ /dev/null @@ -1,42 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP hifi_hikey_lsp */ -/* Linker Script for ld -r or ld -i */ - -/* Default entry point: */ -ENTRY(_ResetVector) - -SECTIONS -{ - - .text 0 : - { - *(.literal .text) - } - - .bss 0 : - { - *(.dynsbss) - *(.sbss) - *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - } - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } -} - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xu b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xu deleted file mode 100644 index d8e1986d..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/ldscripts/elf32xtensa.xu +++ /dev/null @@ -1,42 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP hifi_hikey_lsp */ -/* Linker Script for ld -Ur */ - -/* Default entry point: */ -ENTRY(_ResetVector) - -SECTIONS -{ - - .text 0 : - { - *(.literal .text) - } - - .bss 0 : - { - *(.dynsbss) - *(.sbss) - *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - } - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } -} - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/memmap.xmm b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/memmap.xmm deleted file mode 100644 index c7a94bc8..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/memmap.xmm +++ /dev/null @@ -1,49 +0,0 @@ - - -BEGIN iram0 -0xe8080000: instRam : iram0 : 0xc000 : executable, writable ; - iram0_0 : F : 0xe8080000 - 0xe80802ff : .ResetVector.text; - iram0_1 : C : 0xe8080300 - 0xe80803ff : .Reset.literal; - iram0_2 : F : 0xe8080400 - 0xe8080577 : .WindowVectors.text; - iram0_3 : C : 0xe8080578 - 0xe808057f : .Level2InterruptVector.literal; - iram0_4 : F : 0xe8080580 - 0xe80805b7 : .Level2InterruptVector.text; - iram0_5 : C : 0xe80805b8 - 0xe80805bf : .Level3InterruptVector.literal; - iram0_6 : F : 0xe80805c0 - 0xe80805f7 : .Level3InterruptVector.text; - iram0_7 : C : 0xe80805f8 - 0xe80805ff : .Level4InterruptVector.literal; - iram0_8 : F : 0xe8080600 - 0xe8080637 : .Level4InterruptVector.text; - iram0_9 : C : 0xe8080638 - 0xe808063f : .DebugExceptionVector.literal; - iram0_10 : F : 0xe8080640 - 0xe8080677 : .DebugExceptionVector.text; - iram0_11 : C : 0xe8080678 - 0xe80806bf : .NMIExceptionVector.literal; - iram0_12 : F : 0xe80806c0 - 0xe80806f7 : .NMIExceptionVector.text; - iram0_13 : C : 0xe80806f8 - 0xe80806ff : .KernelExceptionVector.literal; - iram0_14 : F : 0xe8080700 - 0xe8080737 : .KernelExceptionVector.text; - iram0_15 : C : 0xe8080738 - 0xe808073f : .UserExceptionVector.literal; - iram0_16 : F : 0xe8080740 - 0xe8080777 : .UserExceptionVector.text; - iram0_17 : C : 0xe8080778 - 0xe80807bf : .DoubleExceptionVector.literal; - iram0_18 : F : 0xe80807c0 - 0xe80807ff : .DoubleExceptionVector.text; - iram0_19 : C : 0xe8080800 - 0xe808bfff : .iram0.literal .Reset.text .iram0.text; -END iram0 - -BEGIN dram0 -0xe8058000: dataRam : dram0 : 0x28000 : writable ; - dram0_0 : C : 0xe8058000 - 0xe807ffff : STACK : HEAP : .dram0.rodata .dram0.literal .dram0.data .dram0.bss .om.debug.bss .os.stack.bss; -END dram0 - -BEGIN sram -0xc0000000: sysram : sram : 0x600000 : executable, writable ; - sram0 : C : 0xc0000000 - 0xC0407FFF : .sram.shareaddr .sram.rodata .rodata .sram.literal .literal .sram.text .text .sram.data .data .sram.uninit .sram.pool.bss .sram.bss .bss; - old_vlpd : C : 0xC0408000 - 0xC0417FFF : .vlpd.rodata .vlpd.data .vlpd.bss; - efr_fr_hr_vlpd : C : 0xC0418000 - 0xC0427FFF : .efr_fr_hr_vlpd.rodata .efr_fr_hr_vlpd.data .efr_fr_hr_vlpd.bss; - amr_vlpd : C : 0xC0428000 - 0xC0437FFF : .amr_vlpd.rodata .amr_vlpd.data .amr_vlpd.bss; - amrwb_vlpd : C : 0xC0438000 - 0xC0447FFF : .amrwb_vlpd.rodata .amrwb_vlpd.data .amrwb_vlpd.bss; - evrc_evrcb_vlpt : C : 0xC0448000 - 0xC048FFFF : .evrc_evrcb_vlpt.literal .evrc_evrcb_vlpt.text; - efr_fr_hr_vlpt : C : 0xC0490000 - 0xC04BFFFF : .efr_fr_hr_vlpt.literal .efr_fr_hr_vlpt.text; - amr_vlpt : C : 0xC04C0000 - 0xC04DFFFF : .amr_vlpt.literal .amr_vlpt.text; - amrwb_vlpt : C : 0xC04E0000 -0xC050FFFF : .amrwb_vlpt.literal .amrwb_vlpt.text; - vlpt : C : 0xC0510000 - 0xC0557FFF : .vlpt.literal .vlpt.text; - vlpd : C : 0xC0558000 - 0xC0577FFF : .low_power_dyn_alloc; - ulpp : C : 0xc0578000 - 0xc05b7fff : .ulpp.rodata .ulpp.data .ulpp.literal .ulpp.text .ulpp.bss; - dtsv3 : C : 0xc05b8000 - 0xc05d7fff : .dtsv3.rodata .dtsv3.data .dtsv3.literal .dtsv3.text .dtsv3.bss; - dtsv4 : C : 0xc05d8000 - 0xc05fffff : .dtsv4.rodata .dtsv4.data .dtsv4.literal .dtsv4.text .dtsv4.bss; -END sram - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/min-rt.parm b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/min-rt.parm deleted file mode 100644 index 25083eeb..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/min-rt.parm +++ /dev/null @@ -1,15 +0,0 @@ -// Memory map file to generate linker scripts for programs without board I/O. - -// $Id: //depot/rel/Cottonwood/Xtensa/SWConfig/ldscripts/min-rt.parm#1 $ - -// Customer ID=9470; Build=0x42f97; Copyright (c) 2004-2007 by Tensilica Inc. ALL RIGHTS RESERVED. -// These coded instructions, statements, and computer programs are the -// copyrighted works and confidential proprietary information of Tensilica Inc. -// They may not be modified, copied, reproduced, distributed, or disclosed to -// third parties in any manner, medium, or form, in whole or in part, without -// the prior written consent of Tensilica Inc. - -// Show more details if configuration targets the XT2000 board: -INCLUDE_XT2000_MEMORIES = try -RESERVE_SEGMENT_AREA = ".i_ocram.text 0x7800 + 0 start : .d_ocram.data 0x5000 + 0 start" - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/specs b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/specs deleted file mode 100644 index 2988e02a..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/specs +++ /dev/null @@ -1,22 +0,0 @@ -# Customer ID=9470; Build=0x42f97; Copyright (c) 2001-2010 by Tensilica Inc. ALL RIGHTS RESERVED. -# These coded instructions, statements, and computer programs are the -# copyrighted works and confidential proprietary information of Tensilica Inc. -# They may not be modified, copied, reproduced, distributed, or disclosed to -# third parties in any manner, medium, or form, in whole or in part, without -# the prior written consent of Tensilica Inc. - - -# The %O suffix on the start and end files indicates that the system's -# standard suffix for object files (e.g., ".o") should be appended. -# The %s suffix tells the compiler driver to search for the file in the -# list of known locations for startfiles. - -*startfile: -crt1-boards%O%s crti%O%s crtbegin%O%s _sharedvectors%O%s _vectors%O%s - -*endfile: -crtend%O%s crtn%O%s - -*lib: --lc -lgloss -lminrt -lc -lhandler-reset -lhandlers-board -lminrt -lhal -lc - diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/tag b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/tag deleted file mode 100644 index 7be80f2a..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/tag +++ /dev/null @@ -1,3 +0,0 @@ -#This file is generated by Xplorer, do not edit. -#Mon Aug 26 15:41:31 CST 2013 -standardlsp=min-rt diff --git a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/user.parm b/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/user.parm deleted file mode 100644 index e69de29b..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/hifi_hikey_lsp/user.parm +++ /dev/null diff --git a/hifi/xaf/hifi-dpf/build_hikey/map_hikey.txt b/hifi/xaf/hifi-dpf/build_hikey/map_hikey.txt deleted file mode 100644 index 58a3efce..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/map_hikey.txt +++ /dev/null @@ -1,2167 +0,0 @@ -Archive member included because of file (symbol) - -../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - objs/hikey/xa-vorbis-decoder.o (xa_vorbis_dec) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - objs/hikey/arch_hifi330.o (xthal_window_spill_nw) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - objs/hikey/xf-shmem.o (xthal_dcache_region_invalidate) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - objs/hikey/xf-shmem.o (xthal_dcache_region_writeback) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid0.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) (xthals_hw_configid0) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid1.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) (xthals_hw_configid1) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_major.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) (xthals_release_major) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_minor.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) (xthals_release_minor) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - objs/hikey/cpu_c.o (xthal_get_intenable) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - objs/hikey/cpu_c.o (xthal_set_intenable) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - objs/hikey/arch_hifi330.o (xthal_restore_extra_nw) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - objs/hikey/arch_hifi330.o (xthal_save_extra_nw) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - objs/hikey/xf-main.o (_xtos_ints_on) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - objs/hikey/mutex.o (_xtos_ints_off) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) (_xtos_intstruct) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (memchr) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (memcmp) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - objs/hikey/xf-io.o (memcpy) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - objs/hikey/xf-io.o (memset) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (qsort) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - objs/hikey/xa-factory.o (strncmp) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (__divsi3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (__modsi3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - objs/hikey/xf-core.o (__adddf3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - objs/hikey/dsp_debug.o (__muldf3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - objs/hikey/dsp_debug.o (__ltdf2) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - objs/hikey/xf-core.o (__fixunsdfsi) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - objs/hikey/dsp_debug.o (__fixunsdfdi) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - objs/hikey/xf-core.o (__floatunsidf) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - objs/hikey/dsp_debug.o (__floatundidf) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (__divdi3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - objs/hikey/dsp_debug.o (__udivdi3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - objs/hikey/dsp_debug.o (__umoddi3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (__vec_memcpy) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) (__vec_memset) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - objs/hikey/xf-core.o (__divdf3) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) (__propagateFloat64NaN) -/scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) (__estimateDiv64To32) - -Memory Configuration - -Name Origin Length Attributes -sram0_seg 0xc0000000 0x00408000 -old_vlpd_seg 0xc0408000 0x00010000 -efr_fr_hr_vlpd_seg 0xc0418000 0x00010000 -amr_vlpd_seg 0xc0428000 0x00010000 -amrwb_vlpd_seg 0xc0438000 0x00010000 -evrc_evrcb_vlpt_seg 0xc0448000 0x00048000 -efr_fr_hr_vlpt_seg 0xc0490000 0x00030000 -amr_vlpt_seg 0xc04c0000 0x00020000 -amrwb_vlpt_seg 0xc04e0000 0x00030000 -vlpt_seg 0xc0510000 0x00048000 -vlpd_seg 0xc0558000 0x00020000 -ulpp_seg 0xc0578000 0x00040000 -dtsv3_seg 0xc05b8000 0x00020000 -dtsv4_seg 0xc05d8000 0x00028000 -dram0_0_seg 0xe8058000 0x00028000 -iram0_0_seg 0xe8080000 0x00000300 -iram0_1_seg 0xe8080300 0x00000100 -iram0_2_seg 0xe8080400 0x00000178 -iram0_3_seg 0xe8080578 0x00000008 -iram0_4_seg 0xe8080580 0x00000038 -iram0_5_seg 0xe80805b8 0x00000008 -iram0_6_seg 0xe80805c0 0x00000038 -iram0_7_seg 0xe80805f8 0x00000008 -iram0_8_seg 0xe8080600 0x00000038 -iram0_9_seg 0xe8080638 0x00000008 -iram0_10_seg 0xe8080640 0x00000038 -iram0_11_seg 0xe8080678 0x00000048 -iram0_12_seg 0xe80806c0 0x00000038 -iram0_13_seg 0xe80806f8 0x00000008 -iram0_14_seg 0xe8080700 0x00000038 -iram0_15_seg 0xe8080738 0x00000008 -iram0_16_seg 0xe8080740 0x00000038 -iram0_17_seg 0xe8080778 0x00000048 -iram0_18_seg 0xe80807c0 0x00000040 -iram0_19_seg 0xe8080800 0x0000b800 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD objs/hikey/cpu_c.o -LOAD objs/hikey/dsp_debug.o -LOAD objs/hikey/dsp_comm.o -LOAD objs/hikey/mutex.o -LOAD objs/hikey/rbtree.o -LOAD objs/hikey/xf-core.o -LOAD objs/hikey/xf-io.o -LOAD objs/hikey/xf-mem.o -LOAD objs/hikey/xf-msg.o -LOAD objs/hikey/xf-sched.o -LOAD objs/hikey/xa-factory.o -LOAD objs/hikey/xf-shmem.o -LOAD objs/hikey/tinyvprintf.o -LOAD objs/hikey/xf-isr.o -LOAD objs/hikey/gdbstub.o -LOAD objs/hikey/xa-class-base.o -LOAD objs/hikey/xa-class-audio-codec.o -LOAD objs/hikey/xa-class-mixer.o -LOAD objs/hikey/xf-main.o -LOAD objs/hikey/xa-pcm.o -LOAD objs/hikey/xa-vorbis-decoder.o -LOAD objs/hikey/xa-mixer.o -LOAD objs/hikey/reset.o -LOAD objs/hikey/int_vector.o -LOAD objs/hikey/arch_hifi330.o -LOAD objs/hikey/gdbstub-entry.o -LOAD ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a -LOAD /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a -LOAD /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a -LOAD /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a -LOAD /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a - 0xe8080000 _memmap_mem_iram0_start = 0xe8080000 - 0xe808c000 _memmap_mem_iram0_end = 0xe808c000 - 0xe8058000 _memmap_mem_dram0_start = 0xe8058000 - 0xe8080000 _memmap_mem_dram0_end = 0xe8080000 - 0xc0000000 _memmap_mem_sram_start = 0xc0000000 - 0xc0600000 _memmap_mem_sram_end = 0xc0600000 - 0xc0000000 _memmap_seg_sram0_start = 0xc0000000 - 0xc0408000 _memmap_seg_sram0_max = 0xc0408000 - 0xc0408000 _memmap_seg_old_vlpd_start = 0xc0408000 - 0xc0418000 _memmap_seg_old_vlpd_max = 0xc0418000 - 0xc0418000 _memmap_seg_efr_fr_hr_vlpd_start = 0xc0418000 - 0xc0428000 _memmap_seg_efr_fr_hr_vlpd_max = 0xc0428000 - 0xc0428000 _memmap_seg_amr_vlpd_start = 0xc0428000 - 0xc0438000 _memmap_seg_amr_vlpd_max = 0xc0438000 - 0xc0438000 _memmap_seg_amrwb_vlpd_start = 0xc0438000 - 0xc0448000 _memmap_seg_amrwb_vlpd_max = 0xc0448000 - 0xc0448000 _memmap_seg_evrc_evrcb_vlpt_start = 0xc0448000 - 0xc0490000 _memmap_seg_evrc_evrcb_vlpt_max = 0xc0490000 - 0xc0490000 _memmap_seg_efr_fr_hr_vlpt_start = 0xc0490000 - 0xc04c0000 _memmap_seg_efr_fr_hr_vlpt_max = 0xc04c0000 - 0xc04c0000 _memmap_seg_amr_vlpt_start = 0xc04c0000 - 0xc04e0000 _memmap_seg_amr_vlpt_max = 0xc04e0000 - 0xc04e0000 _memmap_seg_amrwb_vlpt_start = 0xc04e0000 - 0xc0510000 _memmap_seg_amrwb_vlpt_max = 0xc0510000 - 0xc0510000 _memmap_seg_vlpt_start = 0xc0510000 - 0xc0558000 _memmap_seg_vlpt_max = 0xc0558000 - 0xc0558000 _memmap_seg_vlpd_start = 0xc0558000 - 0xc0578000 _memmap_seg_vlpd_max = 0xc0578000 - 0xc0578000 _memmap_seg_ulpp_start = 0xc0578000 - 0xc05b8000 _memmap_seg_ulpp_max = 0xc05b8000 - 0xc05b8000 _memmap_seg_dtsv3_start = 0xc05b8000 - 0xc05d8000 _memmap_seg_dtsv3_max = 0xc05d8000 - 0xc05d8000 _memmap_seg_dtsv4_start = 0xc05d8000 - 0xc0600000 _memmap_seg_dtsv4_max = 0xc0600000 - 0xe8058000 _memmap_seg_dram0_0_start = 0xe8058000 - 0xe8080000 _memmap_seg_dram0_0_max = 0xe8080000 - 0xe8080000 _memmap_seg_iram0_0_start = 0xe8080000 - 0xe8080300 _memmap_seg_iram0_0_max = 0xe8080300 - 0xe8080300 _memmap_seg_iram0_1_start = 0xe8080300 - 0xe8080400 _memmap_seg_iram0_1_max = 0xe8080400 - 0xe8080400 _memmap_seg_iram0_2_start = 0xe8080400 - 0xe8080578 _memmap_seg_iram0_2_max = 0xe8080578 - 0xe8080578 _memmap_seg_iram0_3_start = 0xe8080578 - 0xe8080580 _memmap_seg_iram0_3_max = 0xe8080580 - 0xe8080580 _memmap_seg_iram0_4_start = 0xe8080580 - 0xe80805b8 _memmap_seg_iram0_4_max = 0xe80805b8 - 0xe80805b8 _memmap_seg_iram0_5_start = 0xe80805b8 - 0xe80805c0 _memmap_seg_iram0_5_max = 0xe80805c0 - 0xe80805c0 _memmap_seg_iram0_6_start = 0xe80805c0 - 0xe80805f8 _memmap_seg_iram0_6_max = 0xe80805f8 - 0xe80805f8 _memmap_seg_iram0_7_start = 0xe80805f8 - 0xe8080600 _memmap_seg_iram0_7_max = 0xe8080600 - 0xe8080600 _memmap_seg_iram0_8_start = 0xe8080600 - 0xe8080638 _memmap_seg_iram0_8_max = 0xe8080638 - 0xe8080638 _memmap_seg_iram0_9_start = 0xe8080638 - 0xe8080640 _memmap_seg_iram0_9_max = 0xe8080640 - 0xe8080640 _memmap_seg_iram0_10_start = 0xe8080640 - 0xe8080678 _memmap_seg_iram0_10_max = 0xe8080678 - 0xe8080678 _memmap_seg_iram0_11_start = 0xe8080678 - 0xe80806c0 _memmap_seg_iram0_11_max = 0xe80806c0 - 0xe80806c0 _memmap_seg_iram0_12_start = 0xe80806c0 - 0xe80806f8 _memmap_seg_iram0_12_max = 0xe80806f8 - 0xe80806f8 _memmap_seg_iram0_13_start = 0xe80806f8 - 0xe8080700 _memmap_seg_iram0_13_max = 0xe8080700 - 0xe8080700 _memmap_seg_iram0_14_start = 0xe8080700 - 0xe8080738 _memmap_seg_iram0_14_max = 0xe8080738 - 0xe8080738 _memmap_seg_iram0_15_start = 0xe8080738 - 0xe8080740 _memmap_seg_iram0_15_max = 0xe8080740 - 0xe8080740 _memmap_seg_iram0_16_start = 0xe8080740 - 0xe8080778 _memmap_seg_iram0_16_max = 0xe8080778 - 0xe8080778 _memmap_seg_iram0_17_start = 0xe8080778 - 0xe80807c0 _memmap_seg_iram0_17_max = 0xe80807c0 - 0xe80807c0 _memmap_seg_iram0_18_start = 0xe80807c0 - 0xe8080800 _memmap_seg_iram0_18_max = 0xe8080800 - 0xe8080800 _memmap_seg_iram0_19_start = 0xe8080800 - 0xe808c000 _memmap_seg_iram0_19_max = 0xe808c000 - 0x00000000 _rom_store_table = 0x0 - 0xe8080400 PROVIDE (_memmap_vecbase_reset, 0xe8080400) - 0xe8080000 PROVIDE (_memmap_reset_vector, 0xe8080000) - 0x44000000 _memmap_cacheattr_wb_base = 0x44000000 - 0x11000000 _memmap_cacheattr_wt_base = 0x11000000 - 0x22000000 _memmap_cacheattr_bp_base = 0x22000000 - 0x00ffffff _memmap_cacheattr_unused_mask = 0xffffff - 0x4422222f _memmap_cacheattr_wb_trapnull = 0x4422222f - 0x4422222f _memmap_cacheattr_wba_trapnull = 0x4422222f - 0x5522222f _memmap_cacheattr_wbna_trapnull = 0x5522222f - 0x1122222f _memmap_cacheattr_wt_trapnull = 0x1122222f - 0x2222222f _memmap_cacheattr_bp_trapnull = 0x2222222f - 0x44ffffff _memmap_cacheattr_wb_strict = 0x44ffffff - 0x11ffffff _memmap_cacheattr_wt_strict = 0x11ffffff - 0x22ffffff _memmap_cacheattr_bp_strict = 0x22ffffff - 0x44222222 _memmap_cacheattr_wb_allvalid = 0x44222222 - 0x11222222 _memmap_cacheattr_wt_allvalid = 0x11222222 - 0x22222222 _memmap_cacheattr_bp_allvalid = 0x22222222 - 0x4422222f PROVIDE (_memmap_cacheattr_reset, _memmap_cacheattr_wb_trapnull) - -.vlpd.rodata 0xc0408000 0x0 - 0xc0408000 _vlpd_rodata_start = ABSOLUTE (.) - *(.vlpd.rodata) - 0xc0408000 _vlpd_rodata_end = ABSOLUTE (.) - -.vlpd.data 0xc0408000 0x0 - 0xc0408000 _vlpd_data_start = ABSOLUTE (.) - *(.vlpd.data) - 0xc0408000 _vlpd_data_end = ABSOLUTE (.) - -.vlpd.bss 0xc0408000 0x0 - 0xc0408000 . = ALIGN (0x8) - 0xc0408000 _vlpd_bss_start = ABSOLUTE (.) - *(.vlpd.bss) - 0xc0408000 . = ALIGN (0x8) - 0xc0408000 _vlpd_bss_end = ABSOLUTE (.) - 0xc0408000 _memmap_seg_old_vlpd_end = ALIGN (0x8) - -.efr_fr_hr_vlpd.rodata - 0xc0418000 0x0 - 0xc0418000 _efr_fr_hr_vlpd_rodata_start = ABSOLUTE (.) - *(.efr_fr_hr_vlpd.rodata) - 0xc0418000 _efr_fr_hr_vlpd_rodata_end = ABSOLUTE (.) - -.efr_fr_hr_vlpd.data - 0xc0418000 0x0 - 0xc0418000 _efr_fr_hr_vlpd_data_start = ABSOLUTE (.) - *(.efr_fr_hr_vlpd.data) - 0xc0418000 _efr_fr_hr_vlpd_data_end = ABSOLUTE (.) - -.efr_fr_hr_vlpd.bss - 0xc0418000 0x0 - 0xc0418000 . = ALIGN (0x8) - 0xc0418000 _efr_fr_hr_vlpd_bss_start = ABSOLUTE (.) - *(.efr_fr_hr_vlpd.bss) - 0xc0418000 . = ALIGN (0x8) - 0xc0418000 _efr_fr_hr_vlpd_bss_end = ABSOLUTE (.) - 0xc0418000 _memmap_seg_efr_fr_hr_vlpd_end = ALIGN (0x8) - -.amr_vlpd.rodata - 0xc0428000 0x0 - 0xc0428000 _amr_vlpd_rodata_start = ABSOLUTE (.) - *(.amr_vlpd.rodata) - 0xc0428000 _amr_vlpd_rodata_end = ABSOLUTE (.) - -.amr_vlpd.data 0xc0428000 0x0 - 0xc0428000 _amr_vlpd_data_start = ABSOLUTE (.) - *(.amr_vlpd.data) - 0xc0428000 _amr_vlpd_data_end = ABSOLUTE (.) - -.amr_vlpd.bss 0xc0428000 0x0 - 0xc0428000 . = ALIGN (0x8) - 0xc0428000 _amr_vlpd_bss_start = ABSOLUTE (.) - *(.amr_vlpd.bss) - 0xc0428000 . = ALIGN (0x8) - 0xc0428000 _amr_vlpd_bss_end = ABSOLUTE (.) - 0xc0428000 _memmap_seg_amr_vlpd_end = ALIGN (0x8) - -.amrwb_vlpd.rodata - 0xc0438000 0x0 - 0xc0438000 _amrwb_vlpd_rodata_start = ABSOLUTE (.) - *(.amrwb_vlpd.rodata) - 0xc0438000 _amrwb_vlpd_rodata_end = ABSOLUTE (.) - -.amrwb_vlpd.data - 0xc0438000 0x0 - 0xc0438000 _amrwb_vlpd_data_start = ABSOLUTE (.) - *(.amrwb_vlpd.data) - 0xc0438000 _amrwb_vlpd_data_end = ABSOLUTE (.) - -.amrwb_vlpd.bss - 0xc0438000 0x0 - 0xc0438000 . = ALIGN (0x8) - 0xc0438000 _amrwb_vlpd_bss_start = ABSOLUTE (.) - *(.amrwb_vlpd.bss) - 0xc0438000 . = ALIGN (0x8) - 0xc0438000 _amrwb_vlpd_bss_end = ABSOLUTE (.) - 0xc0438000 _memmap_seg_amrwb_vlpd_end = ALIGN (0x8) - -.evrc_evrcb_vlpt.text - 0xc0448000 0x0 - 0xc0448000 _evrc_evrcb_vlpt_text_start = ABSOLUTE (.) - *(.evrc_evrcb_vlpt.literal .evrc_evrcb_vlpt.text) - 0xc0448000 _evrc_evrcb_vlpt_text_end = ABSOLUTE (.) - 0xc0448000 _memmap_seg_evrc_evrcb_vlpt_end = ALIGN (0x8) - -.efr_fr_hr_vlpt.text - 0xc0490000 0x0 - 0xc0490000 _efr_fr_hr_vlpt_text_start = ABSOLUTE (.) - *(.efr_fr_hr_vlpt.literal .efr_fr_hr_vlpt.text) - 0xc0490000 _efr_fr_hr_vlpt_text_end = ABSOLUTE (.) - 0xc0490000 _memmap_seg_efr_fr_hr_vlpt_end = ALIGN (0x8) - -.amr_vlpt.text 0xc04c0000 0x0 - 0xc04c0000 _amr_vlpt_text_start = ABSOLUTE (.) - *(.amr_vlpt.literal .amr_vlpt.text) - 0xc04c0000 _amr_vlpt_text_end = ABSOLUTE (.) - 0xc04c0000 _memmap_seg_amr_vlpt_end = ALIGN (0x8) - -.amrwb_vlpt.text - 0xc04e0000 0x0 - 0xc04e0000 _amrwb_vlpt_text_start = ABSOLUTE (.) - *(.amrwb_vlpt.literal .amrwb_vlpt.text) - 0xc04e0000 _amrwb_vlpt_text_end = ABSOLUTE (.) - 0xc04e0000 _memmap_seg_amrwb_vlpt_end = ALIGN (0x8) - -.vlpt.text 0xc0510000 0x0 - 0xc0510000 _vlpt_text_start = ABSOLUTE (.) - *(.vlpt.literal .vlpt.text) - 0xc0510000 _vlpt_text_end = ABSOLUTE (.) - 0xc0510000 _memmap_seg_vlpt_end = ALIGN (0x8) - -.low_power_dyn_alloc - 0xc0558000 0x0 - 0xc0558000 _low_power_dyn_alloc_start = ABSOLUTE (.) - *(.low_power_dyn_alloc) - 0xc0558000 _low_power_dyn_alloc_end = ABSOLUTE (.) - 0xc0558000 _memmap_seg_vlpd_end = ALIGN (0x8) - -.ulpp.rodata 0xc0578000 0x0 - 0xc0578000 _ulpp_rodata_start = ABSOLUTE (.) - *(.ulpp.rodata) - 0xc0578000 _ulpp_rodata_end = ABSOLUTE (.) - -.ulpp.data 0xc0578000 0x0 - 0xc0578000 _ulpp_data_start = ABSOLUTE (.) - *(.ulpp.data) - 0xc0578000 _ulpp_data_end = ABSOLUTE (.) - -.ulpp.text 0xc0578000 0x0 - 0xc0578000 _ulpp_text_start = ABSOLUTE (.) - *(.ulpp.literal .ulpp.text) - 0xc0578000 _ulpp_text_end = ABSOLUTE (.) - -.ulpp.bss 0xc0578000 0x0 - 0xc0578000 . = ALIGN (0x8) - 0xc0578000 _ulpp_bss_start = ABSOLUTE (.) - *(.ulpp.bss) - 0xc0578000 . = ALIGN (0x8) - 0xc0578000 _ulpp_bss_end = ABSOLUTE (.) - 0xc0578000 _memmap_seg_ulpp_end = ALIGN (0x8) - -.dtsv3.rodata 0xc05b8000 0x0 - 0xc05b8000 _dtsv3_rodata_start = ABSOLUTE (.) - *(.dtsv3.rodata) - 0xc05b8000 _dtsv3_rodata_end = ABSOLUTE (.) - -.dtsv3.data 0xc05b8000 0x0 - 0xc05b8000 _dtsv3_data_start = ABSOLUTE (.) - *(.dtsv3.data) - 0xc05b8000 _dtsv3_data_end = ABSOLUTE (.) - -.dtsv3.text 0xc05b8000 0x0 - 0xc05b8000 _dtsv3_text_start = ABSOLUTE (.) - *(.dtsv3.literal .dtsv3.text) - 0xc05b8000 _dtsv3_text_end = ABSOLUTE (.) - -.dtsv3.bss 0xc05b8000 0x0 - 0xc05b8000 . = ALIGN (0x8) - 0xc05b8000 _dtsv3_bss_start = ABSOLUTE (.) - *(.dtsv3.bss) - 0xc05b8000 . = ALIGN (0x8) - 0xc05b8000 _dtsv3_bss_end = ABSOLUTE (.) - 0xc05b8000 _memmap_seg_dtsv3_end = ALIGN (0x8) - -.dtsv4.rodata 0xc05d8000 0x0 - 0xc05d8000 _dtsv4_rodata_start = ABSOLUTE (.) - *(.dtsv4.rodata) - 0xc05d8000 _dtsv4_rodata_end = ABSOLUTE (.) - -.dtsv4.data 0xc05d8000 0x0 - 0xc05d8000 _dtsv4_data_start = ABSOLUTE (.) - *(.dtsv4.data) - 0xc05d8000 _dtsv4_data_end = ABSOLUTE (.) - -.dtsv4.text 0xc05d8000 0x0 - 0xc05d8000 _dtsv4_text_start = ABSOLUTE (.) - *(.dtsv4.literal .dtsv4.text) - 0xc05d8000 _dtsv4_text_end = ABSOLUTE (.) - -.dtsv4.bss 0xc05d8000 0x0 - 0xc05d8000 . = ALIGN (0x8) - 0xc05d8000 _dtsv4_bss_start = ABSOLUTE (.) - *(.dtsv4.bss) - 0xc05d8000 . = ALIGN (0x8) - 0xc05d8000 _dtsv4_bss_end = ABSOLUTE (.) - 0xc05d8000 _memmap_seg_dtsv4_end = ALIGN (0x8) - -.dram0.rodata 0xe8058000 0x0 - 0xe8058000 _dram0_rodata_start = ABSOLUTE (.) - *(.dram0.rodata) - *(.dram.rodata) - 0xe8058000 _dram0_rodata_end = ABSOLUTE (.) - -.dram0.literal 0xe8058000 0x0 - 0xe8058000 _dram0_literal_start = ABSOLUTE (.) - *(.dram0.literal) - *(.dram.literal) - 0xe8058000 _dram0_literal_end = ABSOLUTE (.) - -.dram0.data 0xe8058000 0x51 - 0xe8058000 _dram0_data_start = ABSOLUTE (.) - *(.dram0.data) - .dram0.data 0xe8058000 0x50 objs/hikey/int_vector.o - 0xe8058030 g_awVosCoprocOwnerSa - 0xe8058038 g_strVosPanicMessage - .dram0.data 0xe8058050 0x1 objs/hikey/arch_hifi330.o - *(.dram.data) - 0xe8058051 _dram0_data_end = ABSOLUTE (.) - -.dram0.bss 0xe8058058 0x0 - 0xe8058058 . = ALIGN (0x8) - 0xe8058058 _dram0_bss_start = ABSOLUTE (.) - *(.dram0.bss) - *(.om.debug.bss) - *(.os.stack.bss) - 0xe8058058 . = ALIGN (0x8) - 0xe8058058 _dram0_bss_end = ABSOLUTE (.) - 0xe8058058 _end = ALIGN (0x8) - 0xe8058058 PROVIDE (end, ALIGN (0x8)) - 0xe8058058 _stack_sentry = ALIGN (0x8) - 0xe8058058 _memmap_seg_dram0_0_end = ALIGN (0x8) - 0xe8080000 __stack = 0xe8080000 - 0xe8080000 _heap_sentry = 0xe8080000 - -.ResetVector.text - 0xe8080000 0x3 - 0xe8080000 _ResetVector_text_start = ABSOLUTE (.) - *(.ResetVector.text) - .ResetVector.text - 0xe8080000 0x3 objs/hikey/reset.o - 0xe8080000 _ResetVector - 0xe8080003 _ResetVector_text_end = ABSOLUTE (.) - 0xe8080008 _memmap_seg_iram0_0_end = ALIGN (0x8) - -.Reset.literal 0xe8080300 0x40 - 0xe8080300 _Reset_literal_start = ABSOLUTE (.) - *(.Reset.literal) - .Reset.literal - 0xe8080300 0x40 objs/hikey/reset.o - 0xe8080340 _Reset_literal_end = ABSOLUTE (.) - 0xe8080340 _memmap_seg_iram0_1_end = ALIGN (0x8) - -.WindowVectors.text - 0xe8080400 0x16a - 0xe8080400 _WindowVectors_text_start = ABSOLUTE (.) - *(.WindowVectors.text) - .WindowVectors.text - 0xe8080400 0x16a objs/hikey/int_vector.o - 0xe8080400 _WindowOverflow4 - 0xe8080440 _WindowUnderflow4 - 0xe8080450 OS_AllocaException - 0xe8080480 _WindowOverflow8 - 0xe80804c0 _WindowUnderflow8 - 0xe8080500 _WindowOverflow12 - 0xe8080540 _WindowUnderflow12 - 0xe808056a _WindowVectors_text_end = ABSOLUTE (.) - 0xe8080570 _memmap_seg_iram0_2_end = ALIGN (0x8) - -.Level2InterruptVector.literal - 0xe8080578 0x0 - 0xe8080578 _Level2InterruptVector_literal_start = ABSOLUTE (.) - *(.Level2InterruptVector.literal) - .Level2InterruptVector.literal - 0xe8080578 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe8080578 _Level2InterruptVector_literal_end = ABSOLUTE (.) - 0xe8080578 _memmap_seg_iram0_3_end = ALIGN (0x8) - -.Level2InterruptVector.text - 0xe8080580 0x6 - 0xe8080580 _Level2InterruptVector_text_start = ABSOLUTE (.) - *(.Level2InterruptVector.text) - .Level2InterruptVector.text - 0xe8080580 0x6 objs/hikey/int_vector.o - 0x9 (size before relaxing) - 0xe8080580 OS_Level2Vector - 0xe8080586 _Level2InterruptVector_text_end = ABSOLUTE (.) - 0xe8080588 _memmap_seg_iram0_4_end = ALIGN (0x8) - -.Level3InterruptVector.literal - 0xe80805b8 0x0 - 0xe80805b8 _Level3InterruptVector_literal_start = ABSOLUTE (.) - *(.Level3InterruptVector.literal) - .Level3InterruptVector.literal - 0xe80805b8 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe80805b8 _Level3InterruptVector_literal_end = ABSOLUTE (.) - 0xe80805b8 _memmap_seg_iram0_5_end = ALIGN (0x8) - -.Level3InterruptVector.text - 0xe80805c0 0x6 - 0xe80805c0 _Level3InterruptVector_text_start = ABSOLUTE (.) - *(.Level3InterruptVector.text) - .Level3InterruptVector.text - 0xe80805c0 0x6 objs/hikey/int_vector.o - 0x9 (size before relaxing) - 0xe80805c0 OS_Level3Vector - 0xe80805c6 _Level3InterruptVector_text_end = ABSOLUTE (.) - 0xe80805c8 _memmap_seg_iram0_6_end = ALIGN (0x8) - -.Level4InterruptVector.literal - 0xe80805f8 0x0 - 0xe80805f8 _Level4InterruptVector_literal_start = ABSOLUTE (.) - *(.Level4InterruptVector.literal) - 0xe80805f8 _Level4InterruptVector_literal_end = ABSOLUTE (.) - 0xe80805f8 _memmap_seg_iram0_7_end = ALIGN (0x8) - -.Level4InterruptVector.text - 0xe8080600 0x0 - 0xe8080600 _Level4InterruptVector_text_start = ABSOLUTE (.) - *(.Level4InterruptVector.text) - 0xe8080600 _Level4InterruptVector_text_end = ABSOLUTE (.) - 0xe8080600 _memmap_seg_iram0_8_end = ALIGN (0x8) - -.DebugExceptionVector.literal - 0xe8080638 0x0 - 0xe8080638 _DebugExceptionVector_literal_start = ABSOLUTE (.) - *(.DebugExceptionVector.literal) - .DebugExceptionVector.literal - 0xe8080638 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe8080638 _DebugExceptionVector_literal_end = ABSOLUTE (.) - 0xe8080638 _memmap_seg_iram0_9_end = ALIGN (0x8) - -.DebugExceptionVector.text - 0xe8080640 0x16 - 0xe8080640 _DebugExceptionVector_text_start = ABSOLUTE (.) - *(.DebugExceptionVector.text) - .DebugExceptionVector.text - 0xe8080640 0x9 objs/hikey/int_vector.o - 0xc (size before relaxing) - 0xe8080640 OS_DebugExceptionVector - *fill* 0xe8080649 0x3 - .DebugExceptionVector.text - 0xe808064c 0xa objs/hikey/gdbstub-entry.o - 0xe808064c DebugExceptionVector - 0xe8080656 _DebugExceptionVector_text_end = ABSOLUTE (.) - 0xe8080658 _memmap_seg_iram0_10_end = ALIGN (0x8) - -.NMIExceptionVector.literal - 0xe8080678 0x8 - 0xe8080678 _NMIExceptionVector_literal_start = ABSOLUTE (.) - *(.NMIExceptionVector.literal) - .NMIExceptionVector.literal - 0xe8080678 0x8 objs/hikey/int_vector.o - 0xe8080680 _NMIExceptionVector_literal_end = ABSOLUTE (.) - 0xe8080680 _memmap_seg_iram0_11_end = ALIGN (0x8) - -.NMIExceptionVector.text - 0xe80806c0 0x1b - 0xe80806c0 _NMIExceptionVector_text_start = ABSOLUTE (.) - *(.NMIExceptionVector.text) - .NMIExceptionVector.text - 0xe80806c0 0x1b objs/hikey/int_vector.o - 0xe80806c0 OS_NMIExceptionVector - 0xe80806db _NMIExceptionVector_text_end = ABSOLUTE (.) - 0xe80806e0 _memmap_seg_iram0_12_end = ALIGN (0x8) - -.KernelExceptionVector.literal - 0xe80806f8 0x0 - 0xe80806f8 _KernelExceptionVector_literal_start = ABSOLUTE (.) - *(.KernelExceptionVector.literal) - .KernelExceptionVector.literal - 0xe80806f8 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe80806f8 _KernelExceptionVector_literal_end = ABSOLUTE (.) - 0xe80806f8 _memmap_seg_iram0_13_end = ALIGN (0x8) - -.KernelExceptionVector.text - 0xe8080700 0x6 - 0xe8080700 _KernelExceptionVector_text_start = ABSOLUTE (.) - *(.KernelExceptionVector.text) - .KernelExceptionVector.text - 0xe8080700 0x6 objs/hikey/int_vector.o - 0x9 (size before relaxing) - 0xe8080700 OS_KernelExceptionVector - 0xe8080706 _KernelExceptionVector_text_end = ABSOLUTE (.) - 0xe8080708 _memmap_seg_iram0_14_end = ALIGN (0x8) - -.UserExceptionVector.literal - 0xe8080738 0x0 - 0xe8080738 _UserExceptionVector_literal_start = ABSOLUTE (.) - *(.UserExceptionVector.literal) - .UserExceptionVector.literal - 0xe8080738 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe8080738 _UserExceptionVector_literal_end = ABSOLUTE (.) - 0xe8080738 _memmap_seg_iram0_15_end = ALIGN (0x8) - -.UserExceptionVector.text - 0xe8080740 0x6 - 0xe8080740 _UserExceptionVector_text_start = ABSOLUTE (.) - *(.UserExceptionVector.text) - .UserExceptionVector.text - 0xe8080740 0x6 objs/hikey/int_vector.o - 0x9 (size before relaxing) - 0xe8080740 OS_UserExceptionVector - 0xe8080746 _UserExceptionVector_text_end = ABSOLUTE (.) - 0xe8080748 _memmap_seg_iram0_16_end = ALIGN (0x8) - -.DoubleExceptionVector.literal - 0xe8080778 0x0 - 0xe8080778 _DoubleExceptionVector_literal_start = ABSOLUTE (.) - *(.DoubleExceptionVector.literal) - .DoubleExceptionVector.literal - 0xe8080778 0x0 objs/hikey/int_vector.o - 0x4 (size before relaxing) - 0xe8080778 _DoubleExceptionVector_literal_end = ABSOLUTE (.) - 0xe8080778 _memmap_seg_iram0_17_end = ALIGN (0x8) - -.DoubleExceptionVector.text - 0xe80807c0 0x6 - 0xe80807c0 _DoubleExceptionVector_text_start = ABSOLUTE (.) - *(.DoubleExceptionVector.text) - .DoubleExceptionVector.text - 0xe80807c0 0x6 objs/hikey/int_vector.o - 0x9 (size before relaxing) - 0xe80807c0 OS_DoubleExceptionVector - 0xe80807c6 _DoubleExceptionVector_text_end = ABSOLUTE (.) - 0xe80807c8 _memmap_seg_iram0_18_end = ALIGN (0x8) - -.Reset.text 0xe8080800 0x23d - 0xe8080800 _Reset_text_start = ABSOLUTE (.) - *(.Reset.text) - .Reset.text 0xe8080800 0x23d objs/hikey/reset.o - 0xe8080800 _Reset - 0xe8080a3d _Reset_text_end = ABSOLUTE (.) - -.iram0.text 0xe8080a40 0x600 - 0xe8080a40 _iram0_text_start = ABSOLUTE (.) - *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text) - .iram0.literal - 0xe8080a40 0x44 objs/hikey/int_vector.o - 0x88 (size before relaxing) - .iram0.literal - 0xe8080a84 0x2c objs/hikey/arch_hifi330.o - 0x58 (size before relaxing) - .iram0.text 0xe8080ab0 0x3b4 objs/hikey/int_vector.o - 0x3c0 (size before relaxing) - 0xe8080ab0 OS_Panic - 0xe8080ad0 OS_UserExc - 0xe8080b68 OS_UserExit - 0xe8080dc4 OS_Medint2Exit - 0xe8080e50 OS_Medint3Exit - .iram0.text 0xe8080e64 0x1dc objs/hikey/arch_hifi330.o - 0xe8080e64 VOSStartHighRdy - 0xe8080e7c VOSCtxSw - 0xe8080eac VOSIntCtxSw - 0xe8080ecc OSCPUSaveSR - 0xe8080ed8 OSCPURestoreSR - 0xe8080ee4 OS_TaskSwitch - 0xe8080f24 OS_ContextSave - 0xe8080f90 OS_ContextRestore - 0xe8080fd8 OS_IntEnter - 0xe8081008 OS_IntExit - 0xe8081020 OS_GetTaskCoprocState - 0xe8081040 _iram0_text_end = ABSOLUTE (.) - 0xe8081040 _memmap_seg_iram0_19_end = ALIGN (0x8) - -.sram.shareaddr - 0xc0000000 0x0 - 0xc0000000 _sram_shareaddr_start = ABSOLUTE (.) - *(.sram.shareaddr) - 0xc0000000 _sram_shareaddr_end = ABSOLUTE (.) - -.sram.rodata 0xc0000000 0x0 - 0xc0000000 _sram_rodata_start = ABSOLUTE (.) - *(.sram.rodata) - 0xc0000000 _sram_rodata_end = ABSOLUTE (.) - -.rodata 0xc0000000 0x75a0 - 0xc0000000 _rodata_start = ABSOLUTE (.) - *(.rodata) - .rodata 0xc0000000 0x84 objs/hikey/dsp_debug.o - *fill* 0xc0000084 0xc - .rodata 0xc0000090 0x10f objs/hikey/xf-core.o - *fill* 0xc000019f 0x1 - .rodata 0xc00001a0 0x197 objs/hikey/xf-io.o - *fill* 0xc0000337 0x9 - .rodata 0xc0000340 0x1b objs/hikey/xf-mem.o - *fill* 0xc000035b 0x5 - .rodata 0xc0000360 0x30 objs/hikey/xf-msg.o - .rodata 0xc0000390 0x1d objs/hikey/xf-sched.o - *fill* 0xc00003ad 0x3 - .rodata 0xc00003b0 0x45 objs/hikey/xa-factory.o - *fill* 0xc00003f5 0xb - .rodata 0xc0000400 0x4e objs/hikey/xf-shmem.o - *fill* 0xc000044e 0x2 - .rodata 0xc0000450 0x1ec objs/hikey/tinyvprintf.o - *fill* 0xc000063c 0x4 - .rodata 0xc0000640 0x120 objs/hikey/gdbstub.o - 0xc0000640 rx - 0xc0000644 tx - .rodata 0xc0000760 0x140 objs/hikey/xa-class-base.o - .rodata 0xc00008a0 0x1e7 objs/hikey/xa-class-audio-codec.o - *fill* 0xc0000a87 0x9 - .rodata 0xc0000a90 0x1d1 objs/hikey/xa-class-mixer.o - *fill* 0xc0000c61 0xf - .rodata 0xc0000c70 0x15 objs/hikey/xf-main.o - *fill* 0xc0000c85 0xb - .rodata 0xc0000c90 0x2ed objs/hikey/xa-pcm.o - *fill* 0xc0000f7d 0x3 - .rodata 0xc0000f80 0xc objs/hikey/xa-vorbis-decoder.o - *fill* 0xc0000f8c 0x4 - .rodata 0xc0000f90 0x269 objs/hikey/xa-mixer.o - *fill* 0xc00011f9 0x7 - .rodata 0xc0001200 0x4a54 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - *(.rodata.*) - .rodata.str1.4 - 0xc0005c54 0x7 objs/hikey/dsp_debug.o - *fill* 0xc0005c5b 0x1 - .rodata.str1.4 - 0xc0005c5c 0x2e1 objs/hikey/xf-core.o - *fill* 0xc0005f3d 0x3 - .rodata.str1.4 - 0xc0005f40 0x2fb objs/hikey/xf-io.o - 0x363 (size before relaxing) - *fill* 0xc000623b 0x1 - .rodata.str1.4 - 0xc000623c 0x50 objs/hikey/xf-mem.o - 0x8c (size before relaxing) - .rodata.str1.4 - 0xc000628c 0x15 objs/hikey/xf-msg.o - 0x49 (size before relaxing) - *fill* 0xc00062a1 0x3 - .rodata.str1.4 - 0xc00062a4 0x56 objs/hikey/xf-sched.o - *fill* 0xc00062fa 0x2 - .rodata.str1.4 - 0xc00062fc 0x68 objs/hikey/xa-factory.o - 0x70 (size before relaxing) - .rodata.str1.4 - 0xc0006364 0xa8 objs/hikey/xf-shmem.o - 0xe4 (size before relaxing) - .rodata.str1.4 - 0xc000640c 0x11 objs/hikey/tinyvprintf.o - *fill* 0xc000641d 0x3 - .rodata.str1.4 - 0xc0006420 0x3f objs/hikey/gdbstub.o - *fill* 0xc000645f 0x1 - .rodata.str1.4 - 0xc0006460 0x6b6 objs/hikey/xa-class-base.o - 0x6f2 (size before relaxing) - *fill* 0xc0006b16 0x2 - .rodata.str1.4 - 0xc0006b18 0x41b objs/hikey/xa-class-audio-codec.o - 0x517 (size before relaxing) - *fill* 0xc0006f33 0x1 - .rodata.str1.4 - 0xc0006f34 0x3cf objs/hikey/xa-class-mixer.o - 0x58b (size before relaxing) - *fill* 0xc0007303 0x1 - .rodata.str1.4 - 0xc0007304 0x4c objs/hikey/xf-main.o - 0x8c (size before relaxing) - .rodata.str1.4 - 0xc0007350 0x86 objs/hikey/xa-pcm.o - 0xc2 (size before relaxing) - *fill* 0xc00073d6 0x2 - .rodata.str1.4 - 0xc00073d8 0x129 objs/hikey/xa-mixer.o - 0x169 (size before relaxing) - *fill* 0xc0007501 0x3 - .rodata.str1.4 - 0xc0007504 0x8 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - 0x7 (size before relaxing) - *(.gnu.linkonce.r.*) - *(.rodata1) - 0xc000750c __XT_EXCEPTION_TABLE__ = ABSOLUTE (.) - *(.xt_except_table) - *(.gcc_except_table) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - *(.eh_frame) - .eh_frame 0xc000750c 0x24 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .eh_frame 0xc0007530 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - 0x24 (size before relaxing) - .eh_frame 0xc0007544 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - 0x24 (size before relaxing) - *crtbegin.o(.ctors) - *(EXCLUDE_FILE(*crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - *crtbegin.o(.dtors) - *(EXCLUDE_FILE(*crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - 0xc0007558 __XT_EXCEPTION_DESCS__ = ABSOLUTE (.) - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - 0xc0007558 __XT_EXCEPTION_DESCS_END__ = ABSOLUTE (.) - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - 0xc0007558 . = ALIGN (0x4) - 0xc0007558 _bss_table_start = ABSOLUTE (.) - 0xc0007558 0x4 LONG 0xc0408000 _vlpd_bss_start - 0xc000755c 0x4 LONG 0xc0408000 _vlpd_bss_end - 0xc0007560 0x4 LONG 0xc0418000 _efr_fr_hr_vlpd_bss_start - 0xc0007564 0x4 LONG 0xc0418000 _efr_fr_hr_vlpd_bss_end - 0xc0007568 0x4 LONG 0xc0428000 _amr_vlpd_bss_start - 0xc000756c 0x4 LONG 0xc0428000 _amr_vlpd_bss_end - 0xc0007570 0x4 LONG 0xc0438000 _amrwb_vlpd_bss_start - 0xc0007574 0x4 LONG 0xc0438000 _amrwb_vlpd_bss_end - 0xc0007578 0x4 LONG 0xc0578000 _ulpp_bss_start - 0xc000757c 0x4 LONG 0xc0578000 _ulpp_bss_end - 0xc0007580 0x4 LONG 0xc05b8000 _dtsv3_bss_start - 0xc0007584 0x4 LONG 0xc05b8000 _dtsv3_bss_end - 0xc0007588 0x4 LONG 0xc05d8000 _dtsv4_bss_start - 0xc000758c 0x4 LONG 0xc05d8000 _dtsv4_bss_end - 0xc0007590 0x4 LONG 0xe8058058 _dram0_bss_start - 0xc0007594 0x4 LONG 0xe8058058 _dram0_bss_end - 0xc0007598 0x4 LONG 0xc001a300 _bss_start - 0xc000759c 0x4 LONG 0xc011b628 _bss_end - 0xc00075a0 _bss_table_end = ABSOLUTE (.) - 0xc00075a0 _rodata_end = ABSOLUTE (.) - -.sram.text 0xc00075a0 0x0 - 0xc00075a0 _sram_text_start = ABSOLUTE (.) - *(.sram.literal .sram.text) - 0xc00075a0 _sram_text_end = ABSOLUTE (.) - -.text 0xc00075a0 0x12b4c - 0xc00075a0 _stext = . - 0xc00075a0 _text_start = ABSOLUTE (.) - *(.entry.text) - *(.init.literal) - *(.init) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - .text 0xc00075a0 0xc3 objs/hikey/cpu_c.o - 0xd9 (size before relaxing) - 0xc00075a4 OS_EnterIntHook - 0xc00075bc OS_ExitIntHook - 0xc00075d8 OS_UserexecHandler - 0xc00075f8 OS_InterruptHandler - 0xc0007610 OS_NmiHook - 0xc000762c VOS_ConnectInterrupt - 0xc000763c VOS_EnableInterrupt - 0xc0007658 VOS_DisableInterrupt - *fill* 0xc0007663 0x5 - .text 0xc0007668 0x59a objs/hikey/dsp_debug.o - 0x5da (size before relaxing) - 0xc0007690 __xprintf - 0xc0007b60 dsp_debug_init - 0xc0007bd8 print_log - *fill* 0xc0007c02 0x6 - .text 0xc0007c08 0x40 objs/hikey/mutex.o - .text 0xc0007c48 0x535 objs/hikey/rbtree.o - 0x53d (size before relaxing) - 0xc0007c80 rb_first - 0xc0007ca0 rb_last - 0xc0007cc0 rb_next - 0xc0007d00 rb_prev - 0xc0007d40 rb_init - 0xc0007d54 rb_insert - 0xc0007e84 rb_delete - 0xc0008138 rb_replace - *fill* 0xc000817d 0x3 - .text 0xc0008180 0x899 objs/hikey/xf-core.o - 0xaa4 (size before relaxing) - 0xc0008538 xf_msg_submit - 0xc00085b4 xf_msg_complete - 0xc0008614 xf_core_init - 0xc000874c xf_core_service - 0xc0008a00 xf_global_init - *fill* 0xc0008a19 0x7 - .text 0xc0008a20 0x79b objs/hikey/xf-io.o - 0x88b (size before relaxing) - 0xc0008a78 xf_input_port_init - 0xc0008b0c xf_input_port_put - 0xc0008bf4 xf_input_port_fill - 0xc0008c9c xf_input_port_pad - 0xc0008cc8 xf_input_port_consume - 0xc0008d38 xf_input_port_purge - 0xc0008da0 xf_input_port_control_save - 0xc0008de8 xf_input_port_purge_done - 0xc0008e34 xf_input_port_destroy - 0xc0008e84 xf_output_port_init - 0xc0008ec4 xf_output_port_route - 0xc0008fe0 xf_output_port_unroute_start - 0xc0008ff4 xf_output_port_unroute_done - 0xc0009020 xf_output_port_unroute - 0xc0009088 xf_output_port_put - 0xc00090ac xf_output_port_data - 0xc00090c0 xf_output_port_produce - 0xc00090f0 xf_output_port_flush - 0xc0009158 xf_output_port_flush_done - 0xc000918c xf_output_port_destroy - *fill* 0xc00091bb 0x5 - .text 0xc00091c0 0x2e0 objs/hikey/xf-mem.o - 0x338 (size before relaxing) - 0xc000924c xf_mm_alloc - 0xc00092ec xf_mm_free - 0xc000940c xf_mm_init - .text 0xc00094a0 0x153 objs/hikey/xf-msg.o - 0x173 (size before relaxing) - 0xc00094f0 xf_msg_pool_init - 0xc000957c xf_msg_pool_destroy - 0xc00095b0 xf_msg_pool_get - 0xc00095e8 xf_msg_pool_put - *fill* 0xc00095f3 0x5 - .text 0xc00095f8 0x127 objs/hikey/xf-sched.o - 0x14a (size before relaxing) - 0xc0009640 xf_sched_put - 0xc00096b0 xf_sched_get - 0xc00096f8 xf_sched_cancel - 0xc0009714 xf_sched_init - *fill* 0xc000971f 0x1 - .text 0xc0009720 0x91 objs/hikey/xa-factory.o - 0xa1 (size before relaxing) - 0xc000976c xf_component_factory - *fill* 0xc00097b1 0x7 - .text 0xc00097b8 0x532 objs/hikey/xf-shmem.o - 0x61a (size before relaxing) - 0xc0009a68 xf_shmem_process_queues - 0xc0009bd4 xf_msg_proxy_complete - 0xc0009c4c xf_shmem_init - *fill* 0xc0009cea 0x6 - .text 0xc0009cf0 0x380 objs/hikey/tinyvprintf.o - 0xc0009d0c tiny_vsprintf - 0xc000a04c tiny_sprintf - .text 0xc000a070 0x108 objs/hikey/xf-isr.o - 0x120 (size before relaxing) - 0xc000a0b4 xf_msg_schedule_isr - 0xc000a11c xf_msg_complete_isr - .text 0xc000a178 0xe34 objs/hikey/gdbstub.o - 0x100c (size before relaxing) - 0xc000a18c init_debug_comm - 0xc000a1d4 poll_debug_ring - 0xc000a36c getpacket - 0xc000aa64 handle_exception - 0xc000af5c init_gdbstub - *fill* 0xc000afac 0x4 - .text 0xc000afb0 0x1622 objs/hikey/xa-class-base.o - 0x1cea (size before relaxing) - 0xc000b0c4 xa_base_set_param - 0xc000b82c xa_base_get_param - 0xc000b968 xa_base_set_param_ext - 0xc000bb80 xa_base_get_param_ext - 0xc000c17c xa_base_schedule - 0xc000c1d4 xa_base_cancel - 0xc000c22c xa_base_destroy - 0xc000c2a8 xa_base_factory - *fill* 0xc000c5d2 0x6 - .text 0xc000c5d8 0x14e3 objs/hikey/xa-class-audio-codec.o - 0x1afb (size before relaxing) - 0xc000da44 xa_audio_codec_factory - *fill* 0xc000dabb 0x5 - .text 0xc000dac0 0x144a objs/hikey/xa-class-mixer.o - 0x1aaa (size before relaxing) - 0xc000ee98 xa_mixer_factory - *fill* 0xc000ef0a 0x6 - .text 0xc000ef10 0x185 objs/hikey/xf-main.o - 0x205 (size before relaxing) - 0xc000ef6c xf_ipc_init - 0xc000efe8 main - *fill* 0xc000f095 0x3 - .text 0xc000f098 0xf0f objs/hikey/xa-pcm.o - 0x13e7 (size before relaxing) - 0xc000ff3c xa_pcm_codec - *fill* 0xc000ffa7 0x1 - .text 0xc000ffa8 0x46 objs/hikey/xa-vorbis-decoder.o - 0x4e (size before relaxing) - 0xc000ffb0 xa_vorbis_decoder - *fill* 0xc000ffee 0x2 - .text 0xc000fff0 0xc77 objs/hikey/xa-mixer.o - 0x10cf (size before relaxing) - 0xc0010bfc xa_mixer - *fill* 0xc0010c67 0x1 - .literal 0xc0010c68 0x10 objs/hikey/gdbstub-entry.o - 0x2c (size before relaxing) - .literal 0xc0010c78 0x4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .literal 0xc0010c7c 0x4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .literal 0xc0010c80 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - 0x4 (size before relaxing) - .literal 0xc0010c80 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .literal 0xc0010c88 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - 0x8 (size before relaxing) - .literal 0xc0010c88 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - 0xc (size before relaxing) - .literal 0xc0010c90 0x4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - 0x10 (size before relaxing) - .literal 0xc0010c94 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - 0x18 (size before relaxing) - .literal 0xc0010c94 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - 0x4 (size before relaxing) - .literal 0xc0010c94 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - 0x4 (size before relaxing) - .literal 0xc0010c94 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - 0x8 (size before relaxing) - .literal 0xc0010c94 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - 0x4 (size before relaxing) - .literal 0xc0010c94 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - 0x2c (size before relaxing) - .literal 0xc0010c9c 0xc /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - 0x1c (size before relaxing) - .literal 0xc0010ca8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - 0xc (size before relaxing) - .text 0xc0010ca8 0x138 objs/hikey/gdbstub-entry.o - 0xc0010ca8 DebugExceptionEntry - 0xc0010dc8 init_debug_entry - 0xc0010dd8 breakpoint - *fill* 0xc0010de0 0x0 - .text 0xc0010de0 0x7321 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - 0x7339 (size before relaxing) - 0xc0013ef8 xa_vorbis_dec - *fill* 0xc0018101 0x3 - .text 0xc0018104 0x137 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - 0xc0018104 xthal_window_spill_nw - 0xc0018104 xthal_spill_registers_into_stack_nw - 0xc0018218 xthal_window_spill - *fill* 0xc001823b 0x1 - .text 0xc001823c 0x22 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - 0xc001823c _xtos_ints_on - *fill* 0xc001825e 0x2 - .text 0xc0018260 0x25 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - 0xc0018260 _xtos_ints_off - *fill* 0xc0018285 0x3 - .text 0xc0018288 0x7c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - 0xc0018288 memchr - *fill* 0xc0018304 0x4 - .text 0xc0018308 0x84 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - 0xc0018308 strncmp - .text 0xc001838c 0x2fa /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - 0xc00183ac __adddf3 - 0xc0018500 __subdf3 - *fill* 0xc0018686 0x2 - .text 0xc0018688 0x1ff /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - 0xc0018768 __muldf3 - *fill* 0xc0018887 0x1 - .text 0xc0018888 0x176 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - 0xc0018888 __eqdf2 - 0xc0018888 __nedf2 - 0xc00188bc __gtdf2 - 0xc00188e4 __ledf2 - 0xc0018948 __gedf2 - 0xc0018970 __ltdf2 - 0xc00189d4 __unorddf2 - *fill* 0xc00189fe 0x2 - .text 0xc0018a00 0x5d /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - 0xc0018a00 __fixunsdfsi - *fill* 0xc0018a5d 0x3 - .text 0xc0018a60 0x75 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - 0xc0018a60 __fixunsdfdi - *fill* 0xc0018ad5 0x3 - .text 0xc0018ad8 0xa3 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - 0xc0018ad8 __vec_memcpy - *fill* 0xc0018b7b 0x5 - .text 0xc0018b80 0x71 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - 0xc0018b80 __vec_memset - *fill* 0xc0018bf1 0x7 - .text 0xc0018bf8 0x318 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - 0xc0018bf8 __divdf3 - .text 0xc0018f10 0x29a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - 0xc0018f10 __propagateFloat64NaN - 0xc00190c0 __roundAndPackFloat64 - *fill* 0xc00191aa 0x6 - .text 0xc00191b0 0x6d /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - 0xc00191b0 __estimateDiv64To32 - *fill* 0xc001921d 0x3 - .literal 0xc0019220 0x0 objs/hikey/cpu_c.o - *fill* 0xc0019220 0x0 - .literal 0xc0019220 0x0 objs/hikey/dsp_debug.o - *fill* 0xc0019220 0x0 - *fill* 0xc0019220 0x0 - .literal 0xc0019220 0x0 objs/hikey/dsp_comm.o - *fill* 0xc0019220 0x0 - .text 0xc0019220 0xda objs/hikey/dsp_comm.o - 0xc0019220 dsp_memcpy - 0xc00192a0 dsp_memset - 0xc00192d4 division - *fill* 0xc00192fa 0x2 - .literal 0xc00192fc 0x0 objs/hikey/mutex.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/rbtree.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-core.o - .literal 0xc00192fc 0x0 objs/hikey/xf-io.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-mem.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-msg.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-sched.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-factory.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-shmem.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/tinyvprintf.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-isr.o - .literal 0xc00192fc 0x0 objs/hikey/gdbstub.o - .literal 0xc00192fc 0x0 objs/hikey/xa-class-base.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-class-audio-codec.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-class-mixer.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xf-main.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-pcm.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-vorbis-decoder.o - *fill* 0xc00192fc 0x0 - .literal 0xc00192fc 0x0 objs/hikey/xa-mixer.o - .text 0xc00192fc 0x0 objs/hikey/reset.o - .text 0xc00192fc 0x0 objs/hikey/int_vector.o - .text 0xc00192fc 0x0 objs/hikey/arch_hifi330.o - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x0 - *fill* 0xc00192fc 0x4 - .text 0xc0019300 0x1c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - 0xc0019300 xthal_dcache_region_invalidate - *fill* 0xc001931c 0x4 - .text 0xc0019320 0x1c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - 0xc0019320 xthal_dcache_region_writeback - .text 0xc001933c 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid0.o) - .text 0xc001933c 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid1.o) - .text 0xc001933c 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_major.o) - .text 0xc001933c 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_minor.o) - .text 0xc001933c 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - 0xc001933c xthal_get_intenable - .text 0xc0019344 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - 0xc0019344 xthal_set_intenable - .text 0xc001934c 0x2a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - 0xc001934c xthal_restore_extra_nw - *fill* 0xc0019376 0x2 - .text 0xc0019378 0x2a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - 0xc0019378 xthal_save_extra_nw - *fill* 0xc00193a2 0x0 - *fill* 0xc00193a2 0x0 - *fill* 0xc00193a2 0x2 - .text 0xc00193a4 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - 0xc00193a4 _xtos_unhandled_interrupt - *fill* 0xc00193ac 0x4 - .text 0xc00193b0 0x45 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - 0xc00193b0 memcmp - *fill* 0xc00193f5 0x3 - .text 0xc00193f8 0x138 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - 0xc001943c memcpy - .text 0xc0019530 0x78 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - 0xc001955c memset - .literal 0xc00195a8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .text 0xc00195a8 0x338 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - 0xc001962c qsort - .text 0xc00198e0 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - 0xc00198e0 __divsi3 - .text 0xc00198e8 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - 0xc00198e8 __modsi3 - *fill* 0xc00198f0 0x0 - *fill* 0xc00198f0 0x0 - *fill* 0xc00198f0 0x0 - *fill* 0xc00198f0 0x0 - *fill* 0xc00198f0 0x0 - .text 0xc00198f0 0x3e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - 0xc00198f0 __floatunsidf - 0xc00198fc __floatsidf - *fill* 0xc001992e 0x2 - .text 0xc0019930 0x84 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - 0xc0019930 __floatundidf - 0xc0019940 __floatdidf - *fill* 0xc00199b4 0x4 - .text 0xc00199b8 0x271 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - 0xc00199b8 __divdi3 - *fill* 0xc0019c29 0x7 - .text 0xc0019c30 0x24c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - 0xc0019c30 __udivdi3 - *fill* 0xc0019e7c 0x4 - .text 0xc0019e80 0x26c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - 0xc0019e80 __umoddi3 - *fill* 0xc001a0ec 0x0 - *fill* 0xc001a0ec 0x0 - *fill* 0xc001a0ec 0x0 - *fill* 0xc001a0ec 0x0 - *fill* 0xc001a0ec 0x0 - *(.fini.literal) - *(.fini) - *(.gnu.version) - 0xc001a0ec _text_end = ABSOLUTE (.) - 0xc001a0ec _etext = . - -.sram.data 0xc001a0ec 0x0 - 0xc001a0ec _sram_data_start = ABSOLUTE (.) - *(.sram.data) - 0xc001a0ec _sram_data_end = ABSOLUTE (.) - -.data 0xc001a0f0 0x208 - 0xc001a0f0 _data_start = ABSOLUTE (.) - *(.data) - .data 0xc001a0f0 0x0 objs/hikey/cpu_c.o - .data 0xc001a0f0 0x0 objs/hikey/dsp_debug.o - .data 0xc001a0f0 0x0 objs/hikey/dsp_comm.o - .data 0xc001a0f0 0x0 objs/hikey/mutex.o - .data 0xc001a0f0 0x0 objs/hikey/rbtree.o - .data 0xc001a0f0 0x0 objs/hikey/xf-core.o - .data 0xc001a0f0 0x0 objs/hikey/xf-io.o - .data 0xc001a0f0 0x0 objs/hikey/xf-mem.o - .data 0xc001a0f0 0x0 objs/hikey/xf-msg.o - .data 0xc001a0f0 0x0 objs/hikey/xf-sched.o - .data 0xc001a0f0 0x0 objs/hikey/xa-factory.o - .data 0xc001a0f0 0x0 objs/hikey/xf-shmem.o - .data 0xc001a0f0 0x0 objs/hikey/tinyvprintf.o - .data 0xc001a0f0 0x0 objs/hikey/xf-isr.o - .data 0xc001a0f0 0x0 objs/hikey/gdbstub.o - .data 0xc001a0f0 0x0 objs/hikey/xa-class-base.o - .data 0xc001a0f0 0x0 objs/hikey/xa-class-audio-codec.o - .data 0xc001a0f0 0x0 objs/hikey/xa-class-mixer.o - .data 0xc001a0f0 0x0 objs/hikey/xf-main.o - .data 0xc001a0f0 0x0 objs/hikey/xa-pcm.o - .data 0xc001a0f0 0x0 objs/hikey/xa-vorbis-decoder.o - .data 0xc001a0f0 0x0 objs/hikey/xa-mixer.o - .data 0xc001a0f0 0x0 objs/hikey/reset.o - .data 0xc001a0f0 0x0 objs/hikey/int_vector.o - .data 0xc001a0f0 0x0 objs/hikey/arch_hifi330.o - .data 0xc001a0f0 0x0 objs/hikey/gdbstub-entry.o - .data 0xc001a0f0 0x0 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid0.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid1.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_major.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_minor.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .data 0xc001a0f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .data 0xc001a0f0 0x208 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - 0xc001a0f0 _xtos_enabled - 0xc001a0f0 _xtos_intstruct - 0xc001a0f4 _xtos_vpri_enabled - 0xc001a0f8 _xtos_interrupt_table - 0xc001a1f8 _xtos_interrupt_mask_table - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .data 0xc001a2f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - *(.data.*) - *(.gnu.linkonce.d.*) - *(.gnu.linkonce.d.*personality*) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - *(.jcr) - 0xc001a2f8 _data_end = ABSOLUTE (.) - -.sram.uninit 0xc001a2f8 0x0 - 0xc001a2f8 _sram_uninit_start = ABSOLUTE (.) - *(.sram.uninit) - 0xc001a2f8 _sram_uninit_end = ABSOLUTE (.) - -.bss 0xc001a300 0x101328 - 0xc001a300 . = ALIGN (0x8) - 0xc001a300 _bss_start = ABSOLUTE (.) - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - .bss 0xc001a300 0xb0 objs/hikey/cpu_c.o - 0xc001a300 g_ucVosIntNesting - 0xc001a301 g_ucVosPrioCur - 0xc001a302 g_ucVosPrioHighRdy - 0xc001a304 g_bVosRunning - 0xc001a308 g_pstVosTCBHighRdy - 0xc001a30c g_pstVosTCBCur - 0xc001a310 g_pfVosHookFuncTable - 0xc001a330 g_pfVosIntrFuncTable - .bss 0xc001a3b0 0x4 objs/hikey/dsp_debug.o - .bss 0xc001a3b4 0x0 objs/hikey/dsp_comm.o - .bss 0xc001a3b4 0x0 objs/hikey/mutex.o - .bss 0xc001a3b4 0x0 objs/hikey/rbtree.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-core.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-io.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-mem.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-msg.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-sched.o - .bss 0xc001a3b4 0x0 objs/hikey/xa-factory.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-shmem.o - .bss 0xc001a3b4 0x0 objs/hikey/tinyvprintf.o - .bss 0xc001a3b4 0x0 objs/hikey/xf-isr.o - *fill* 0xc001a3b4 0xc - .bss 0xc001a3c0 0xb70 objs/hikey/gdbstub.o - 0xc001a3c0 mem_err - 0xc001a530 sregs - 0xc001aa30 aregs - 0xc001ab30 stack - .bss 0xc001af30 0x0 objs/hikey/xa-class-base.o - .bss 0xc001af30 0x0 objs/hikey/xa-class-audio-codec.o - .bss 0xc001af30 0x0 objs/hikey/xa-class-mixer.o - *fill* 0xc001af30 0x50 - .bss 0xc001af80 0x1006a8 objs/hikey/xf-main.o - 0xc001af80 xf_dsp_local_buffer - 0xc011b2c0 waitstate - 0xc011b2c8 prof - 0xc011b318 xf_ap_shmem_pool - 0xc011b340 xf_core_data - 0xc011b500 xf_core_rw_data - 0xc011b580 xf_core_ro_data - 0xc011b600 xf_dsp_local_pool - .bss 0xc011b628 0x0 objs/hikey/xa-pcm.o - .bss 0xc011b628 0x0 objs/hikey/xa-vorbis-decoder.o - .bss 0xc011b628 0x0 objs/hikey/xa-mixer.o - .bss 0xc011b628 0x0 objs/hikey/reset.o - .bss 0xc011b628 0x0 objs/hikey/int_vector.o - .bss 0xc011b628 0x0 objs/hikey/arch_hifi330.o - .bss 0xc011b628 0x0 objs/hikey/gdbstub-entry.o - .bss 0xc011b628 0x0 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid0.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid1.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_major.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_minor.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .bss 0xc011b628 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - *(.sram.pool.bss) - *(.sram.bss) - 0xc011b628 . = ALIGN (0x8) - 0xc011b628 _bss_end = ABSOLUTE (.) - 0xc011b628 _memmap_seg_sram0_end = ALIGN (0x8) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0x7b0 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x20 objs/hikey/cpu_c.o - .debug_aranges - 0x00000020 0x20 objs/hikey/dsp_debug.o - .debug_aranges - 0x00000040 0x20 objs/hikey/dsp_comm.o - .debug_aranges - 0x00000060 0x20 objs/hikey/mutex.o - .debug_aranges - 0x00000080 0x20 objs/hikey/rbtree.o - .debug_aranges - 0x000000a0 0x20 objs/hikey/xf-core.o - .debug_aranges - 0x000000c0 0x20 objs/hikey/xf-io.o - .debug_aranges - 0x000000e0 0x20 objs/hikey/xf-mem.o - .debug_aranges - 0x00000100 0x20 objs/hikey/xf-msg.o - .debug_aranges - 0x00000120 0x20 objs/hikey/xf-sched.o - .debug_aranges - 0x00000140 0x20 objs/hikey/xa-factory.o - .debug_aranges - 0x00000160 0x20 objs/hikey/xf-shmem.o - .debug_aranges - 0x00000180 0x20 objs/hikey/tinyvprintf.o - .debug_aranges - 0x000001a0 0x20 objs/hikey/xf-isr.o - .debug_aranges - 0x000001c0 0x20 objs/hikey/gdbstub.o - .debug_aranges - 0x000001e0 0x20 objs/hikey/xa-class-base.o - .debug_aranges - 0x00000200 0x20 objs/hikey/xa-class-audio-codec.o - .debug_aranges - 0x00000220 0x20 objs/hikey/xa-class-mixer.o - .debug_aranges - 0x00000240 0x20 objs/hikey/xf-main.o - .debug_aranges - 0x00000260 0x20 objs/hikey/xa-pcm.o - .debug_aranges - 0x00000280 0x20 objs/hikey/xa-vorbis-decoder.o - .debug_aranges - 0x000002a0 0x20 objs/hikey/xa-mixer.o - .debug_aranges - 0x000002c0 0x28 objs/hikey/reset.o - .debug_aranges - 0x000002e8 0x60 objs/hikey/int_vector.o - .debug_aranges - 0x00000348 0x20 objs/hikey/arch_hifi330.o - .debug_aranges - 0x00000368 0x28 objs/hikey/gdbstub-entry.o - .debug_aranges - 0x00000390 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .debug_aranges - 0x000003b0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .debug_aranges - 0x000003d0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .debug_aranges - 0x000003f0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .debug_aranges - 0x00000410 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .debug_aranges - 0x00000430 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .debug_aranges - 0x00000450 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .debug_aranges - 0x00000470 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .debug_aranges - 0x00000490 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .debug_aranges - 0x000004b0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .debug_aranges - 0x000004d0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .debug_aranges - 0x000004f0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .debug_aranges - 0x00000510 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .debug_aranges - 0x00000530 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .debug_aranges - 0x00000550 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .debug_aranges - 0x00000570 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .debug_aranges - 0x00000590 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .debug_aranges - 0x000005b0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .debug_aranges - 0x000005d0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .debug_aranges - 0x000005f0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .debug_aranges - 0x00000610 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .debug_aranges - 0x00000630 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .debug_aranges - 0x00000650 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .debug_aranges - 0x00000670 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .debug_aranges - 0x00000690 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .debug_aranges - 0x000006b0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .debug_aranges - 0x000006d0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .debug_aranges - 0x000006f0 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .debug_aranges - 0x00000710 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .debug_aranges - 0x00000730 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .debug_aranges - 0x00000750 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .debug_aranges - 0x00000770 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .debug_aranges - 0x00000790 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug_pubnames - 0x00000000 0xb7d - *(.debug_pubnames) - .debug_pubnames - 0x00000000 0x16f objs/hikey/cpu_c.o - .debug_pubnames - 0x0000016f 0x41 objs/hikey/dsp_debug.o - .debug_pubnames - 0x000001b0 0x3d objs/hikey/dsp_comm.o - .debug_pubnames - 0x000001ed 0x7a objs/hikey/rbtree.o - .debug_pubnames - 0x00000267 0x70 objs/hikey/xf-core.o - .debug_pubnames - 0x000002d7 0x21d objs/hikey/xf-io.o - .debug_pubnames - 0x000004f4 0x40 objs/hikey/xf-mem.o - .debug_pubnames - 0x00000534 0x67 objs/hikey/xf-msg.o - .debug_pubnames - 0x0000059b 0x5a objs/hikey/xf-sched.o - .debug_pubnames - 0x000005f5 0x2b objs/hikey/xa-factory.o - .debug_pubnames - 0x00000620 0x5a objs/hikey/xf-shmem.o - .debug_pubnames - 0x0000067a 0x35 objs/hikey/tinyvprintf.o - .debug_pubnames - 0x000006af 0x42 objs/hikey/xf-isr.o - .debug_pubnames - 0x000006f1 0xa6 objs/hikey/gdbstub.o - .debug_pubnames - 0x00000797 0xc2 objs/hikey/xa-class-base.o - .debug_pubnames - 0x00000859 0x2d objs/hikey/xa-class-audio-codec.o - .debug_pubnames - 0x00000886 0x27 objs/hikey/xa-class-mixer.o - .debug_pubnames - 0x000008ad 0xbe objs/hikey/xf-main.o - .debug_pubnames - 0x0000096b 0x23 objs/hikey/xa-pcm.o - .debug_pubnames - 0x0000098e 0x28 objs/hikey/xa-vorbis-decoder.o - .debug_pubnames - 0x000009b6 0x1f objs/hikey/xa-mixer.o - .debug_pubnames - 0x000009d5 0x1d /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .debug_pubnames - 0x000009f2 0x1d /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .debug_pubnames - 0x00000a0f 0x1c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .debug_pubnames - 0x00000a2b 0x1e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .debug_pubnames - 0x00000a49 0x1f /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .debug_pubnames - 0x00000a68 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .debug_pubnames - 0x00000a88 0x20 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .debug_pubnames - 0x00000aa8 0x23 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .debug_pubnames - 0x00000acb 0x23 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .debug_pubnames - 0x00000aee 0x1f /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .debug_pubnames - 0x00000b0d 0x46 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .debug_pubnames - 0x00000b53 0x2a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug_info 0x00000000 0x18e3c - *(.debug_info) - .debug_info 0x00000000 0x516 objs/hikey/cpu_c.o - .debug_info 0x00000516 0x3c2 objs/hikey/dsp_debug.o - .debug_info 0x000008d8 0x208 objs/hikey/dsp_comm.o - .debug_info 0x00000ae0 0xbd5 objs/hikey/mutex.o - .debug_info 0x000016b5 0xf10 objs/hikey/rbtree.o - .debug_info 0x000025c5 0x16ac objs/hikey/xf-core.o - .debug_info 0x00003c71 0x1826 objs/hikey/xf-io.o - .debug_info 0x00005497 0xef6 objs/hikey/xf-mem.o - .debug_info 0x0000638d 0xdc1 objs/hikey/xf-msg.o - .debug_info 0x0000714e 0xdf5 objs/hikey/xf-sched.o - .debug_info 0x00007f43 0xdfd objs/hikey/xa-factory.o - .debug_info 0x00008d40 0x1353 objs/hikey/xf-shmem.o - .debug_info 0x0000a093 0x2d0 objs/hikey/tinyvprintf.o - .debug_info 0x0000a363 0xc73 objs/hikey/xf-isr.o - .debug_info 0x0000afd6 0xa47 objs/hikey/gdbstub.o - .debug_info 0x0000ba1d 0x1c9b objs/hikey/xa-class-base.o - .debug_info 0x0000d6b8 0x1fe2 objs/hikey/xa-class-audio-codec.o - .debug_info 0x0000f69a 0x21c9 objs/hikey/xa-class-mixer.o - .debug_info 0x00011863 0x1203 objs/hikey/xf-main.o - .debug_info 0x00012a66 0x1841 objs/hikey/xa-pcm.o - .debug_info 0x000142a7 0x1f6 objs/hikey/xa-vorbis-decoder.o - .debug_info 0x0001449d 0x12e9 objs/hikey/xa-mixer.o - .debug_info 0x00015786 0x95 objs/hikey/reset.o - .debug_info 0x0001581b 0x9a objs/hikey/int_vector.o - .debug_info 0x000158b5 0xa0 objs/hikey/arch_hifi330.o - .debug_info 0x00015955 0x9c objs/hikey/gdbstub-entry.o - .debug_info 0x000159f1 0xdf /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .debug_info 0x00015ad0 0xd9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .debug_info 0x00015ba9 0xd9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .debug_info 0x00015c82 0xd7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .debug_info 0x00015d59 0xd7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .debug_info 0x00015e30 0xd9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .debug_info 0x00015f09 0xd9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .debug_info 0x00015fe2 0xd9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .debug_info 0x000160bb 0xda /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .debug_info 0x00016195 0xe1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .debug_info 0x00016276 0x22e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .debug_info 0x000164a4 0x20a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .debug_info 0x000166ae 0x11c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .debug_info 0x000167ca 0x11c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .debug_info 0x000168e6 0x399 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .debug_info 0x00016c7f 0x204 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .debug_info 0x00016e83 0xf7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .debug_info 0x00016f7a 0xf7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .debug_info 0x00017071 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .debug_info 0x00017167 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .debug_info 0x0001725d 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .debug_info 0x00017353 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .debug_info 0x00017449 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .debug_info 0x0001753f 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .debug_info 0x00017635 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .debug_info 0x0001772b 0x2b1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .debug_info 0x000179dc 0x26e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .debug_info 0x00017c4a 0x278 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .debug_info 0x00017ec2 0x2c3 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .debug_info 0x00018185 0x28b /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .debug_info 0x00018410 0x3a7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .debug_info 0x000187b7 0x3ae /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .debug_info 0x00018b65 0x2d7 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug_abbrev 0x00000000 0x2ee0 - *(.debug_abbrev) - .debug_abbrev 0x00000000 0xcd objs/hikey/cpu_c.o - .debug_abbrev 0x000000cd 0x156 objs/hikey/dsp_debug.o - .debug_abbrev 0x00000223 0xa2 objs/hikey/dsp_comm.o - .debug_abbrev 0x000002c5 0x140 objs/hikey/mutex.o - .debug_abbrev 0x00000405 0x201 objs/hikey/rbtree.o - .debug_abbrev 0x00000606 0x28c objs/hikey/xf-core.o - .debug_abbrev 0x00000892 0x255 objs/hikey/xf-io.o - .debug_abbrev 0x00000ae7 0x1ff objs/hikey/xf-mem.o - .debug_abbrev 0x00000ce6 0x1d3 objs/hikey/xf-msg.o - .debug_abbrev 0x00000eb9 0x1b2 objs/hikey/xf-sched.o - .debug_abbrev 0x0000106b 0x17d objs/hikey/xa-factory.o - .debug_abbrev 0x000011e8 0x1f8 objs/hikey/xf-shmem.o - .debug_abbrev 0x000013e0 0xf6 objs/hikey/tinyvprintf.o - .debug_abbrev 0x000014d6 0x184 objs/hikey/xf-isr.o - .debug_abbrev 0x0000165a 0x282 objs/hikey/gdbstub.o - .debug_abbrev 0x000018dc 0x269 objs/hikey/xa-class-base.o - .debug_abbrev 0x00001b45 0x20b objs/hikey/xa-class-audio-codec.o - .debug_abbrev 0x00001d50 0x20b objs/hikey/xa-class-mixer.o - .debug_abbrev 0x00001f5b 0x1b3 objs/hikey/xf-main.o - .debug_abbrev 0x0000210e 0x1aa objs/hikey/xa-pcm.o - .debug_abbrev 0x000022b8 0xa4 objs/hikey/xa-vorbis-decoder.o - .debug_abbrev 0x0000235c 0x1cc objs/hikey/xa-mixer.o - .debug_abbrev 0x00002528 0x12 objs/hikey/reset.o - .debug_abbrev 0x0000253a 0x12 objs/hikey/int_vector.o - .debug_abbrev 0x0000254c 0x14 objs/hikey/arch_hifi330.o - .debug_abbrev 0x00002560 0x12 objs/hikey/gdbstub-entry.o - .debug_abbrev 0x00002572 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .debug_abbrev 0x00002586 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .debug_abbrev 0x0000259a 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .debug_abbrev 0x000025ae 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .debug_abbrev 0x000025c2 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .debug_abbrev 0x000025d6 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .debug_abbrev 0x000025ea 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .debug_abbrev 0x000025fe 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .debug_abbrev 0x00002612 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .debug_abbrev 0x00002626 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .debug_abbrev 0x0000263a 0x8e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .debug_abbrev 0x000026c8 0x85 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .debug_abbrev 0x0000274d 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .debug_abbrev 0x00002761 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .debug_abbrev 0x00002775 0xcf /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .debug_abbrev 0x00002844 0x80 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .debug_abbrev 0x000028c4 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .debug_abbrev 0x000028d8 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .debug_abbrev 0x000028ec 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .debug_abbrev 0x00002900 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .debug_abbrev 0x00002914 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .debug_abbrev 0x00002928 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .debug_abbrev 0x0000293c 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .debug_abbrev 0x00002950 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .debug_abbrev 0x00002964 0x14 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .debug_abbrev 0x00002978 0xbd /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .debug_abbrev 0x00002a35 0xa1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .debug_abbrev 0x00002ad6 0xae /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .debug_abbrev 0x00002b84 0xa3 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .debug_abbrev 0x00002c27 0x82 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .debug_abbrev 0x00002ca9 0xbb /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .debug_abbrev 0x00002d64 0xd0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .debug_abbrev 0x00002e34 0xac /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug_line 0x00000000 0xd0d8 - *(.debug_line) - .debug_line 0x00000000 0x14b objs/hikey/cpu_c.o - .debug_line 0x0000014b 0x433 objs/hikey/dsp_debug.o - .debug_line 0x0000057e 0x105 objs/hikey/dsp_comm.o - .debug_line 0x00000683 0x1fc objs/hikey/mutex.o - .debug_line 0x0000087f 0x8f3 objs/hikey/rbtree.o - .debug_line 0x00001172 0x8a9 objs/hikey/xf-core.o - .debug_line 0x00001a1b 0xb08 objs/hikey/xf-io.o - .debug_line 0x00002523 0x4c3 objs/hikey/xf-mem.o - .debug_line 0x000029e6 0x2cf objs/hikey/xf-msg.o - .debug_line 0x00002cb5 0x32f objs/hikey/xf-sched.o - .debug_line 0x00002fe4 0x233 objs/hikey/xa-factory.o - .debug_line 0x00003217 0x70b objs/hikey/xf-shmem.o - .debug_line 0x00003922 0x268 objs/hikey/tinyvprintf.o - .debug_line 0x00003b8a 0x33e objs/hikey/xf-isr.o - .debug_line 0x00003ec8 0x9d7 objs/hikey/gdbstub.o - .debug_line 0x0000489f 0x92f objs/hikey/xa-class-base.o - .debug_line 0x000051ce 0xb85 objs/hikey/xa-class-audio-codec.o - .debug_line 0x00005d53 0xcd5 objs/hikey/xa-class-mixer.o - .debug_line 0x00006a28 0x2e7 objs/hikey/xf-main.o - .debug_line 0x00006d0f 0xbd0 objs/hikey/xa-pcm.o - .debug_line 0x000078df 0x145 objs/hikey/xa-vorbis-decoder.o - .debug_line 0x00007a24 0x94f objs/hikey/xa-mixer.o - .debug_line 0x00008373 0x36b objs/hikey/reset.o - .debug_line 0x000086de 0x7f7 objs/hikey/int_vector.o - .debug_line 0x00008ed5 0x463 objs/hikey/arch_hifi330.o - .debug_line 0x00009338 0x293 objs/hikey/gdbstub-entry.o - .debug_line 0x000095cb 0x337 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .debug_line 0x00009902 0x91 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .debug_line 0x00009993 0x91 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .debug_line 0x00009a24 0x8e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .debug_line 0x00009ab2 0x8f /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .debug_line 0x00009b41 0x8a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .debug_line 0x00009bcb 0x8a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .debug_line 0x00009c55 0xc5 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .debug_line 0x00009d1a 0xcc /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .debug_line 0x00009de6 0x98 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .debug_line 0x00009e7e 0x10f /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .debug_line 0x00009f8d 0xf6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .debug_line 0x0000a083 0x363 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .debug_line 0x0000a3e6 0x19a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .debug_line 0x0000a580 0x25a /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .debug_line 0x0000a7da 0x110 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .debug_line 0x0000a8ea 0xa9 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .debug_line 0x0000a993 0xa8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .debug_line 0x0000aa3b 0x6d1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .debug_line 0x0000b10c 0x4c4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .debug_line 0x0000b5d0 0x3bf /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .debug_line 0x0000b98f 0x167 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .debug_line 0x0000baf6 0x191 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .debug_line 0x0000bc87 0x119 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .debug_line 0x0000bda0 0x1af /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .debug_line 0x0000bf4f 0x1e3 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .debug_line 0x0000c132 0x1c4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .debug_line 0x0000c2f6 0x220 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .debug_line 0x0000c516 0x13d /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .debug_line 0x0000c653 0x137 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .debug_line 0x0000c78a 0x46e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .debug_line 0x0000cbf8 0x36e /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .debug_line 0x0000cf66 0x172 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug_frame - *(.debug_frame) - -.debug_str - *(.debug_str) - -.debug_loc - *(.debug_loc) - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.xt.insn - *(.xt.insn) - *(.gnu.linkonce.x.*) - -.xt.prop 0x00000000 0xe8ec - *(.xt.prop) - .xt.prop 0x00000000 0x15c objs/hikey/cpu_c.o - 0x1ec (size before relaxing) - .xt.prop 0x0000015c 0x570 objs/hikey/dsp_debug.o - 0x594 (size before relaxing) - .xt.prop 0x000006cc 0x84 objs/hikey/dsp_comm.o - .xt.prop 0x00000750 0x3c objs/hikey/mutex.o - 0x48 (size before relaxing) - .xt.prop 0x0000078c 0x6e4 objs/hikey/rbtree.o - 0x6f0 (size before relaxing) - .xt.prop 0x00000e70 0x624 objs/hikey/xf-core.o - 0x6e4 (size before relaxing) - .xt.prop 0x00001494 0x7b0 objs/hikey/xf-io.o - 0x894 (size before relaxing) - .xt.prop 0x00001c44 0x354 objs/hikey/xf-mem.o - 0x390 (size before relaxing) - .xt.prop 0x00001f98 0x12c objs/hikey/xf-msg.o - 0x15c (size before relaxing) - .xt.prop 0x000020c4 0x150 objs/hikey/xf-sched.o - 0x18c (size before relaxing) - .xt.prop 0x00002214 0x9c objs/hikey/xa-factory.o - 0xb4 (size before relaxing) - .xt.prop 0x000022b0 0x36c objs/hikey/xf-shmem.o - 0x3a8 (size before relaxing) - .xt.prop 0x0000261c 0x498 objs/hikey/tinyvprintf.o - 0x4a4 (size before relaxing) - .xt.prop 0x00002ab4 0xe4 objs/hikey/xf-isr.o - 0x108 (size before relaxing) - .xt.prop 0x00002b98 0x9c0 objs/hikey/gdbstub.o - 0xa8c (size before relaxing) - .xt.prop 0x00003558 0xa80 objs/hikey/xa-class-base.o - 0xb28 (size before relaxing) - .xt.prop 0x00003fd8 0xbb8 objs/hikey/xa-class-audio-codec.o - 0xc84 (size before relaxing) - .xt.prop 0x00004b90 0xcf0 objs/hikey/xa-class-mixer.o - 0xdd4 (size before relaxing) - .xt.prop 0x00005880 0xe4 objs/hikey/xf-main.o - 0x18c (size before relaxing) - .xt.prop 0x00005964 0xdec objs/hikey/xa-pcm.o - 0xef4 (size before relaxing) - .xt.prop 0x00006750 0x48 objs/hikey/xa-vorbis-decoder.o - 0x60 (size before relaxing) - .xt.prop 0x00006798 0xaa4 objs/hikey/xa-mixer.o - 0xb7c (size before relaxing) - .xt.prop 0x0000723c 0x6c objs/hikey/reset.o - .xt.prop 0x000072a8 0x300 objs/hikey/int_vector.o - 0x390 (size before relaxing) - .xt.prop 0x000075a8 0x150 objs/hikey/arch_hifi330.o - 0x15c (size before relaxing) - .xt.prop 0x000076f8 0xf0 objs/hikey/gdbstub-entry.o - .xt.prop 0x000077e8 0x5154 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - 0x51d8 (size before relaxing) - .xt.prop 0x0000c93c 0xf0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .xt.prop 0x0000ca2c 0x24 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .xt.prop 0x0000ca50 0x24 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .xt.prop 0x0000ca74 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .xt.prop 0x0000ca8c 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .xt.prop 0x0000caa4 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .xt.prop 0x0000cabc 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .xt.prop 0x0000cad4 0x24 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .xt.prop 0x0000caf8 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - 0x24 (size before relaxing) - .xt.prop 0x0000cb10 0x24 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .xt.prop 0x0000cb34 0x90 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .xt.prop 0x0000cbc4 0x3c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .xt.prop 0x0000cc00 0x144 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .xt.prop 0x0000cd44 0xc0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .xt.prop 0x0000ce04 0x3e4 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - 0x3f0 (size before relaxing) - .xt.prop 0x0000d1e8 0x9c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - 0xa8 (size before relaxing) - .xt.prop 0x0000d284 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .xt.prop 0x0000d29c 0x18 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .xt.prop 0x0000d2b4 0x444 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .xt.prop 0x0000d6f8 0x264 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .xt.prop 0x0000d95c 0x27c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - 0x288 (size before relaxing) - .xt.prop 0x0000dbd8 0x90 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - 0x9c (size before relaxing) - .xt.prop 0x0000dc68 0xc0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - 0xcc (size before relaxing) - .xt.prop 0x0000dd28 0x54 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .xt.prop 0x0000dd7c 0x9c /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .xt.prop 0x0000de18 0x150 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .xt.prop 0x0000df68 0x120 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .xt.prop 0x0000e088 0x120 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .xt.prop 0x0000e1a8 0xa8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - 0xb4 (size before relaxing) - .xt.prop 0x0000e250 0x78 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - 0x84 (size before relaxing) - .xt.prop 0x0000e2c8 0x1ec /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .xt.prop 0x0000e4b4 0x3a8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .xt.prop 0x0000e85c 0x90 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - 0x9c (size before relaxing) - *(.xt.prop.*) - *(.gnu.linkonce.prop.*) - -.xt.lit 0x00000000 0x518 - *(.xt.lit) - .xt.lit 0x00000000 0x18 objs/hikey/cpu_c.o - 0x40 (size before relaxing) - .xt.lit 0x00000018 0x20 objs/hikey/dsp_debug.o - .xt.lit 0x00000038 0x8 objs/hikey/mutex.o - .xt.lit 0x00000040 0x8 objs/hikey/rbtree.o - .xt.lit 0x00000048 0x60 objs/hikey/xf-core.o - 0x68 (size before relaxing) - .xt.lit 0x000000a8 0x70 objs/hikey/xf-io.o - 0x98 (size before relaxing) - .xt.lit 0x00000118 0x18 objs/hikey/xf-mem.o - 0x28 (size before relaxing) - .xt.lit 0x00000130 0x20 objs/hikey/xf-msg.o - .xt.lit 0x00000150 0x18 objs/hikey/xf-sched.o - 0x28 (size before relaxing) - .xt.lit 0x00000168 0x10 objs/hikey/xa-factory.o - .xt.lit 0x00000178 0x20 objs/hikey/xf-shmem.o - 0x30 (size before relaxing) - .xt.lit 0x00000198 0x8 objs/hikey/tinyvprintf.o - .xt.lit 0x000001a0 0x18 objs/hikey/xf-isr.o - .xt.lit 0x000001b8 0x60 objs/hikey/gdbstub.o - 0x70 (size before relaxing) - .xt.lit 0x00000218 0x58 objs/hikey/xa-class-base.o - .xt.lit 0x00000270 0x70 objs/hikey/xa-class-audio-codec.o - 0x78 (size before relaxing) - .xt.lit 0x000002e0 0x78 objs/hikey/xa-class-mixer.o - 0x80 (size before relaxing) - .xt.lit 0x00000358 0x18 objs/hikey/xf-main.o - .xt.lit 0x00000370 0xa8 objs/hikey/xa-pcm.o - .xt.lit 0x00000418 0x8 objs/hikey/xa-vorbis-decoder.o - .xt.lit 0x00000420 0x80 objs/hikey/xa-mixer.o - .xt.lit 0x000004a0 0x8 objs/hikey/reset.o - .xt.lit 0x000004a8 0x10 objs/hikey/int_vector.o - 0x40 (size before relaxing) - .xt.lit 0x000004b8 0x8 objs/hikey/arch_hifi330.o - .xt.lit 0x000004c0 0x8 objs/hikey/gdbstub-entry.o - .xt.lit 0x000004c8 0x18 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - 0x78 (size before relaxing) - .xt.lit 0x000004e0 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .xt.lit 0x000004e8 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .xt.lit 0x000004f0 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - 0x8 (size before relaxing) - .xt.lit 0x000004f0 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .xt.lit 0x000004f8 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - 0x8 (size before relaxing) - .xt.lit 0x000004f8 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .xt.lit 0x00000500 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .xt.lit 0x00000508 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - 0x8 (size before relaxing) - .xt.lit 0x00000508 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - 0x8 (size before relaxing) - .xt.lit 0x00000508 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - 0x8 (size before relaxing) - .xt.lit 0x00000508 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - 0x8 (size before relaxing) - .xt.lit 0x00000508 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - 0x8 (size before relaxing) - .xt.lit 0x00000508 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .xt.lit 0x00000510 0x8 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .xt.lit 0x00000518 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - 0x8 (size before relaxing) - *(.xt.lit.*) - *(.gnu.linkonce.p.*) - -.comment 0x00000000 0x1351 - .comment 0x00000000 0x59 objs/hikey/cpu_c.o - 0x5a (size before relaxing) - .comment 0x00000059 0x5d objs/hikey/dsp_debug.o - 0x5e (size before relaxing) - .comment 0x000000b6 0x5c objs/hikey/dsp_comm.o - 0x5d (size before relaxing) - .comment 0x00000112 0x50 objs/hikey/mutex.o - 0x51 (size before relaxing) - .comment 0x00000162 0x51 objs/hikey/rbtree.o - 0x52 (size before relaxing) - .comment 0x000001b3 0x4d objs/hikey/xf-core.o - 0x4e (size before relaxing) - .comment 0x00000200 0x4b objs/hikey/xf-io.o - 0x4c (size before relaxing) - .comment 0x0000024b 0x4c objs/hikey/xf-mem.o - 0x4d (size before relaxing) - .comment 0x00000297 0x4c objs/hikey/xf-msg.o - 0x4d (size before relaxing) - .comment 0x000002e3 0x4e objs/hikey/xf-sched.o - 0x4f (size before relaxing) - .comment 0x00000331 0x4f objs/hikey/xa-factory.o - 0x50 (size before relaxing) - .comment 0x00000380 0x4e objs/hikey/xf-shmem.o - 0x4f (size before relaxing) - .comment 0x000003ce 0x56 objs/hikey/tinyvprintf.o - 0x57 (size before relaxing) - .comment 0x00000424 0x4c objs/hikey/xf-isr.o - 0x4d (size before relaxing) - .comment 0x00000470 0x5a objs/hikey/gdbstub.o - 0x5b (size before relaxing) - .comment 0x000004ca 0x54 objs/hikey/xa-class-base.o - 0x55 (size before relaxing) - .comment 0x0000051e 0x5b objs/hikey/xa-class-audio-codec.o - 0x5c (size before relaxing) - .comment 0x00000579 0x55 objs/hikey/xa-class-mixer.o - 0x56 (size before relaxing) - .comment 0x000005ce 0x55 objs/hikey/xf-main.o - 0x56 (size before relaxing) - .comment 0x00000623 0x60 objs/hikey/xa-pcm.o - 0x61 (size before relaxing) - .comment 0x00000683 0x6d objs/hikey/xa-vorbis-decoder.o - 0x6e (size before relaxing) - .comment 0x000006f0 0x5f objs/hikey/xa-mixer.o - 0x60 (size before relaxing) - .comment 0x0000074f 0x573 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - 0x584 (size before relaxing) - .comment 0x00000cc2 0xa1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - 0xa2 (size before relaxing) - .comment 0x00000d63 0xa1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - 0xa2 (size before relaxing) - .comment 0x00000e04 0xa0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - 0xa1 (size before relaxing) - .comment 0x00000ea4 0xa2 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - 0xa3 (size before relaxing) - .comment 0x00000f46 0xa1 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - 0xa2 (size before relaxing) - .comment 0x00000000 0xa2 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .comment 0x00000000 0xa2 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .comment 0x00000fe7 0xa5 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - 0xa6 (size before relaxing) - .comment 0x0000108c 0xa5 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - 0xa6 (size before relaxing) - .comment 0x00001131 0xb5 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - 0xb6 (size before relaxing) - .comment 0x000011e6 0xb5 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - 0xb6 (size before relaxing) - .comment 0x0000129b 0xb6 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - 0xb7 (size before relaxing) - -.xtensa.info 0x00000000 0x1d8 - .xtensa.info 0x00000000 0x1d8 objs/hikey/cpu_c.o - .xtensa.info 0x00000000 0x0 objs/hikey/dsp_debug.o - .xtensa.info 0x00000000 0x0 objs/hikey/dsp_comm.o - .xtensa.info 0x00000000 0x0 objs/hikey/mutex.o - .xtensa.info 0x00000000 0x0 objs/hikey/rbtree.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-core.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-io.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-mem.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-msg.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-sched.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-factory.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-shmem.o - .xtensa.info 0x00000000 0x0 objs/hikey/tinyvprintf.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-isr.o - .xtensa.info 0x00000000 0x0 objs/hikey/gdbstub.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-class-base.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-class-audio-codec.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-class-mixer.o - .xtensa.info 0x00000000 0x0 objs/hikey/xf-main.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-pcm.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-vorbis-decoder.o - .xtensa.info 0x00000000 0x0 objs/hikey/xa-mixer.o - .xtensa.info 0x00000000 0x0 objs/hikey/reset.o - .xtensa.info 0x00000000 0x0 objs/hikey/int_vector.o - .xtensa.info 0x00000000 0x0 objs/hikey/arch_hifi330.o - .xtensa.info 0x00000000 0x0 objs/hikey/gdbstub-entry.o - .xtensa.info 0x00000000 0x0 ../plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a(xa_vorbis_dec.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(windowspill_asm.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_invalidate.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--dcache_region_writeback.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid0.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--hw_configid1.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_major.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(cache_asm--release_minor.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--get_intenable.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(int_asm--set_intenable.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--restore_extra_nw.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhal.a(state_asm--save_extra_nw.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-on.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(ints-off.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/arch/lib//libhandlers-board.a(interrupt-table.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memchr.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcmp.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memcpy.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-memset.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-qsort.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib//libc.a(lib_a-strncmp.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divsi3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_modsi3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_addsubdf3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_muldf3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_cmpdf2.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfsi.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_fixunsdfdi.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatsidf.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_floatdidf.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_divdi3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_udivdi3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(_umoddi3.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memcpy.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(vec_memset.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_div_df.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_df.o) - .xtensa.info 0x00000000 0x0 /scratch/speacial_projects/sof-sdk/xtensa_tools/tools/XtDevTools/install/builds/RG-2017.5-linux/hifi3_hikey960/xtensa-elf/lib/xcc//libgcc.a(softfloat_cmn_div.o) - -.debug.xt.callgraph - *(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*) -OUTPUT(objs/hikey/xa_hikey.o elf32-xtensa-le) - -.debug_ranges 0x00000000 0x98 - .debug_ranges 0x00000000 0x20 objs/hikey/reset.o - .debug_ranges 0x00000020 0x58 objs/hikey/int_vector.o - .debug_ranges 0x00000078 0x20 objs/hikey/gdbstub-entry.o diff --git a/hifi/xaf/hifi-dpf/build_hikey/tools/elftobin.sh b/hifi/xaf/hifi-dpf/build_hikey/tools/elftobin.sh deleted file mode 100755 index cebe6bf4..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/tools/elftobin.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash - -if [ $# != 2 ] -then -echo "elftobin.sh <input_elf_file> <output_img_file>" -exit -fi - -if [ $XTENSA_CORE == "" ] -then -echo "XTENSA_CORE is not set" -exit -fi - -if [ $XTENSA_SYSTEM == "" ] -then -echo "XTENSA_SYSTEM is not set" -exit -fi - -export INPUT_ELF_FILE=$1 -export OUTPUT_BIN_FILE=__hikey_temp.bin -export OUTPUT_IMG_FILE=$2 -export OP_DIR=./ - -xt-objdump -h $INPUT_ELF_FILE > __elfdump -less __elfdump | sed -n '/ALLOC/{g;1!p;};h' > __header -less __header | awk '{print $2 " " $3 " " $4}' > __proc - -sections=`less __proc | cut -f1 -d' ' | tr '\n' ',' | sed 's/\,$//g'` -SECTION_NUM=`awk 'END {print NR}' __proc` -echo "Total number of sections are $SECTION_NUM" -#sections=(".dram0.data" ".ResetVector.text" ".Reset.literal" ".WindowVectors.text" ".Level2InterruptVector.literal" ".Level2InterruptVector.text" ".Level3InterruptVector.literal" ".Level3InterruptVector.text" ".DebugExceptionVector.literal" ".DebugExceptionVector.text" ".NMIExceptionVector.literal" ".NMIExceptionVector.text" ".KernelExceptionVector.literal" ".KernelExceptionVector.text" ".UserExceptionVector.literal" ".UserExceptionVector.text" ".DoubleExceptionVector.literal" ".DoubleExceptionVector.text" ".Reset.text" ".iram0.text" ".rodata" ".text" ".data" ".bss") -#dst_addr=("0xe8058000" "0xe8080000" "0xe8080300" "0xe8080400" "0xe8080578" "0xe8080580" "0xe80805b8" "0xe80805c0" "0xe8080638" "0xe8080640" "0xe8080678" "0xe80806c0" "0xe80806f8" "0xe8080700" "0xe8080738" "0xe8080740" "0xe8080778" "0xe80807c0" "0xe8080800" "0xe8080a44" "0xc0000000" "0xc0000cc8" "0xc00025c0" "0xc0002a20") - -ID_Sec=("0x01010000" "0x01000001" "0x01000002" "0x01000003" "0x01000004" "0x01000005" "0x01000006" "0x01000007" "0x01000008" "0x01000009" "0x0100000A" "0x0100000B" "0x0100000C" "0x0100000D" "0x0100000E" "0x0100000F" "0x01000010" "0x01000011" "0x01000012" "0x01000013" "0x00000014" "0x00000015" "0x00010016" "0x00020017") - -head -c "4" /dev/zero > __zero.bin - -i=0 -for j in `seq 1 $SECTION_NUM` -do - VAR=`less __proc | awk 'FNR == "'"$j"'" {print $1}'` - VARBIN=`echo "$VAR" | sed 's/^./__/' | sed "s/\..*//" | sed 's/$/.bin/' ` - #echo "section: $VAR $VARBIN" - xt-objcopy $INPUT_ELF_FILE -O binary --only-section $VAR $VARBIN - - size_sec[${i}]=$(cat $VARBIN | wc -c) - #echo "size : ${size_sec[${i}]}" - mod0=`expr ${size_sec[${i}]} % 4` - nbytes=`expr 4 - $mod0` - if [ "$nbytes" -ne "4" ] ; then - tail -c $nbytes __zero.bin >> $VARBIN - size_sec[$i]=`expr ${size_sec[${i}]} + $nbytes` - fi - cat $VARBIN >> $OUTPUT_BIN_FILE - i=`expr $i + 1`; -done -cd $OP_DIR - -tmp1=$(cat $OUTPUT_BIN_FILE | wc -c) -total_sections=$SECTION_NUM -main_header_size=32 -section_header_size=16 -size_total_img=`expr $main_header_size + $tmp1 + $total_sections \* $section_header_size` -current_date_time=`date "+%Y/%m/%d %H:%M:%S"` -echo "HIF:$current_date_time" > $OUTPUT_IMG_FILE - -printf "0: %.8x" $size_total_img | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE -printf "0: %.8x" $total_sections | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE - -cnt1=`expr $main_header_size + $total_sections \* $section_header_size` -i=0 -for j in `seq 1 $SECTION_NUM` -do - DST_ADDR=`less __proc | awk 'FNR == "'"$j"'" {print $3}'` - printf "0: %.8x" ${ID_Sec[${i}]} | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE - printf "0: %.8x" $cnt1 | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE - printf "0: %.8x" 0x$DST_ADDR | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE - printf "0: %.8x" ${size_sec[${i}]} | sed -e 's/0\: \(..\)\(..\)\(..\)\(..\)/0\: \4\3\2\1/' | xxd -r -g0 >> $OUTPUT_IMG_FILE - cnt_prev=$cnt1 - cnt1=`expr ${size_sec[${i}]} + $cnt_prev` - i=`expr $i + 1` -done - -cat $OUTPUT_BIN_FILE >> $OUTPUT_IMG_FILE -rm $OUTPUT_BIN_FILE -rm __*.bin -rm __proc -rm __elfdump -rm __header - -echo "elftobin successful!" - diff --git a/hifi/xaf/hifi-dpf/build_hikey/xa_hikey.img b/hifi/xaf/hifi-dpf/build_hikey/xa_hikey.img Binary files differdeleted file mode 100644 index 4c166528..00000000 --- a/hifi/xaf/hifi-dpf/build_hikey/xa_hikey.img +++ /dev/null diff --git a/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub-entry.S b/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub-entry.S deleted file mode 100644 index 50a33a93..00000000 --- a/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub-entry.S +++ /dev/null @@ -1,198 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -#include "xtensa-defs.h" - -.macro SAVE_ reg, loc - rsr a1, \reg - s32i a1, a3, \loc * 4 -.endm -.macro SAVE reg - SAVE_ \reg, \reg -.endm - -.macro LOAD_ reg, loc - l32i a1, a3, \loc * 4 - wsr a1, \reg -.endm -.macro LOAD reg - LOAD_ \reg, \reg -.endm - - .section ".DebugExceptionVector.text", "ax" - .global DebugExceptionVector - -DebugExceptionVector: - j 1f - .align 4 - .literal_position -1: - xsr a2, DEBUG_EXCSAVE - jx a2 - - .text - .global DebugExceptionEntry - .align 4 - -DebugExceptionEntry: - j 1f - .align 4 - .literal_position -1: - movi a2, aregs - s32i a0, a2, 0 - s32i a1, a2, 4 - rsr a1, DEBUG_EXCSAVE - s32i a1, a2, 8 - s32i a3, a2, 12 - - movi a3, sregs - SAVE LBEG - SAVE LEND - SAVE LCOUNT - SAVE SAR - SAVE WINDOWBASE - SAVE WINDOWSTART - - rsr a1, DEBUG_PC - movi a2, initial_breakpoint - bne a1, a2, 1f - addi a1, a1, 3 -1: - s32i a1, a3, DEBUG_PC * 4 - - SAVE EXCSAVE_1 - SAVE_ DEBUG_PS, PS - SAVE EXCCAUSE - SAVE DEBUGCAUSE - SAVE EXCVADDR - - movi a1, XCHAL_NUM_AREGS / 4 - 1 - movi a2, aregs -1: - s32i a4, a2, 16 - s32i a5, a2, 20 - s32i a6, a2, 24 - s32i a7, a2, 28 - - addi a6, a2, 16 - addi a5, a1, -1 - rotw 1 - bnez a1, 1b - - movi a1, 1 - wsr a1, windowstart - movi a0, 0 - wsr a0, windowbase - rsync - - movi a0, 0 - movi a1, stack + STACK_SIZE - 20 - rsr a2, ps - addi a2, a2, -PS_EXCM_MASK - wsr a2, ps - rsync - - movi a4, handle_exception - callx4 a4 - -DebugExceptionExit: - movi a2, DebugExceptionEntry - wsr a2, DEBUG_EXCSAVE - - rsr a2, ps - addi a2, a2, PS_EXCM_MASK - wsr a2, ps - rsync - - movi a3, sregs - LOAD LBEG - LOAD LEND - LOAD LCOUNT - /* TODO: handle unlikely return-to-lend case */ - LOAD SAR - LOAD WINDOWBASE - rsync - movi a3, sregs - LOAD WINDOWSTART - LOAD DEBUG_PC - LOAD EXCSAVE_1 - LOAD_ DEBUG_PS, PS - LOAD EXCCAUSE - LOAD EXCVADDR - - movi a6, aregs - movi a5, XCHAL_NUM_AREGS / 4 - 2 -1: - l32i a0, a6, 0 - l32i a1, a6, 4 - l32i a2, a6, 8 - l32i a3, a6, 12 - - beqz a5, 2f - addi a10, a6, 16 - addi a9, a5, -1 - rotw 1 - j 1b -2: - l32i a4, a6, 16 - l32i a5, a6, 20 - l32i a7, a6, 28 - l32i a6, a6, 24 - rotw 2 - - rfi XCHAL_DEBUGLEVEL - - -#ifdef LIBC_LEVEL1_HANDLER - .global fault_handler - .align 4 -fault_handler: - rsr a2, epc1 - addi a2, a2, 3 - wsr a2, epc1 - rsync - movi a2, mem_err - s32i a2, a2, 0 - - l32i a2, a1, 16 - l32i a3, a1, 20 - addi a1, a1, 256 - rfe -#endif - - - .global init_debug_entry - .align 4 -init_debug_entry: - entry a1, 16 - movi a2, DebugExceptionEntry - wsr a2, DEBUG_EXCSAVE - isync - retw - - .global breakpoint - .align 4 -breakpoint: - entry a1, 16 -initial_breakpoint: - _break 0, 0 - retw diff --git a/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub.c b/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub.c deleted file mode 100644 index e125b94c..00000000 --- a/hifi/xaf/hifi-dpf/core/util/gdbstub/gdbstub.c +++ /dev/null @@ -1,756 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/**************************************************************************** - - THIS SOFTWARE IS NOT COPYRIGHTED - - HP offers the following for use in the public domain. HP makes no - warranty with regard to the software or it's performance and the - user accepts the software "AS IS" with all faults. - - HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD - TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -****************************************************************************/ - -/**************************************************************************** - * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ - * - * Module name: remcom.c $ - * Revision: 1.34 $ - * Date: 91/03/09 12:29:49 $ - * Contributor: Lake Stevens Instrument Division$ - * - * Description: low level support for gdb debugger. $ - * - * Considerations: only works on target hardware $ - * - * Written by: Glenn Engel $ - * ModuleState: Experimental $ - * - * NOTES: See Below $ - * - * Modified for SPARC by Stu Grossman, Cygnus Support. - * - * This code has been extensively tested on the Fujitsu SPARClite demo board. - * - * To enable debugger support, two things need to happen. One, a - * call to set_debug_traps() is necessary in order to allow any breakpoints - * or error conditions to be properly intercepted and reported to gdb. - * Two, a breakpoint needs to be generated to begin communication. This - * is most easily accomplished by a call to breakpoint(). Breakpoint() - * simulates a breakpoint by executing a trap #1. - * - ************* - * - * The following gdb commands are supported: - * - * command function Return value - * - * g return the value of the CPU registers hex data or ENN - * G set the value of the CPU registers OK or ENN - * - * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN - * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN - * - * c Resume at current address SNN ( signal NN) - * cAA..AA Continue at address AA..AA SNN - * - * s Step one instruction SNN - * sAA..AA Step one instruction from AA..AA SNN - * - * k kill - * - * ? What was the last sigval ? SNN (signal NN) - * - * All commands and responses are sent with a packet which includes a - * checksum. A packet consists of - * - * $<packet info>#<checksum>. - * - * where - * <packet info> :: <characters representing the command or response> - * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>> - * - * When a packet is received, it is first acknowledged with either '+' or '-'. - * '+' indicates a successful transfer. '-' indicates a failed transfer. - * - * Example: - * - * Host: Reply: - * $m0,10#2a +$00010203040506070809101112131415#42 - * - ****************************************************************************/ -#ifdef XAF_ENABLE_NON_HIKEY -#include "xf.h" -#else -#include <string.h> -#include <signal.h> -#include <stdint.h> -#include <xtensa/xtruntime.h> -#endif -#include "xtensa-defs.h" - -/******************************************************************************* - * Ring-buffer definition - ******************************************************************************/ - -#define RING_SIZE 256 - -struct ring { - unsigned char head; - unsigned char fill1[63]; - unsigned char tail; - unsigned char fill2[63]; - unsigned char data[RING_SIZE]; -}; - -#define GDB_INVALIDATE(p) \ - xthal_dcache_region_invalidate((void *)(p), sizeof(*p)) - -#define GDB_FLUSH(p) \ - xthal_dcache_region_writeback((void *)(p), sizeof(*p)) - -static inline unsigned int ring_next_head(const volatile struct ring *ring) -{ - return (ring->head + 1) & (RING_SIZE - 1); -} - -static inline unsigned int ring_next_tail(const volatile struct ring *ring) -{ - return (ring->tail + 1) & (RING_SIZE - 1); -} - -static inline int ring_have_space(const volatile struct ring *ring) -{ - /* ...invalidate tail pointer of tx-ring (updated by host) */ - GDB_INVALIDATE(&ring->tail); - - return ring_next_head(ring) != ring->tail; -} - -static inline int ring_have_data(const volatile struct ring *ring) -{ - /* ...invalidate head pointer of rx-ring (updated by host) */ - GDB_INVALIDATE(&ring->head); - - return ring->head != ring->tail; -} -#ifdef XAF_ENABLE_NON_HIKEY -#define DEBUG_RX_BASE XF_CFG_GDB_RING_RX -#define DEBUG_TX_BASE XF_CFG_GDB_RING_TX -#else -//#define DEBUG_RX_BASE (0x72000000) -//#define DEBUG_TX_BASE (0x72000800) -#define DEBUG_RX_BASE (0x6FFFF000) -#define DEBUG_TX_BASE (0x6FFFF800) -#endif - -volatile struct ring * const rx = (void *)DEBUG_RX_BASE; -volatile struct ring * const tx = (void *)DEBUG_TX_BASE; - -void init_debug_comm(void) -{ - rx->head = rx->tail = 0; - tx->head = tx->tail = 0; - GDB_FLUSH(&rx->head); - GDB_FLUSH(&rx->tail); - GDB_FLUSH(&tx->head); - GDB_FLUSH(&tx->tail); -} - -/* ...functions defined in asm code */ -extern void breakpoint(void); -extern void init_debug_entry(void); - -void poll_debug_ring(void) -{ - if (ring_have_data(rx)) { - breakpoint(); - } -} - -static void putDebugChar(char c) -{ - while (!ring_have_space(tx)) - ; - - tx->data[tx->head] = c; - - /* ...flush data buffer to main memory */ - GDB_FLUSH(&tx->data[tx->head]); - - tx->head = ring_next_head(tx); - - /* ...flush head pointer to main memory */ - GDB_FLUSH(&tx->head); -} - -static int getDebugChar(void) -{ - int v; - while (!ring_have_data(rx)) - ; - - /* ...inavlidate data buffer */ - GDB_INVALIDATE(&rx->data[rx->tail]); - - v = rx->data[rx->tail]; - rx->tail = ring_next_tail(rx); - - /* ...update tail index */ - GDB_FLUSH(&rx->tail); - - return v; -} - -/************************************************************************/ -/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ -/* at least NUMREGBYTES*2 are needed for register packets */ -#define BUFMAX 256 - -#ifdef USE_GDBSTUB -#define bulk_data __attribute__((section (".ddr0.data"))) -#else -#define bulk_data -#endif -uint32_t stack[STACK_SIZE / sizeof(uint32_t)] bulk_data; -static uint8_t sregs_read[32] bulk_data; -static uint8_t sregs_mod[32] bulk_data; -static uint8_t sregs_late[32] bulk_data; -uint32_t sregs[256] bulk_data; -uint32_t aregs[XCHAL_NUM_AREGS] bulk_data; -static uint8_t remcomInBuffer[BUFMAX] bulk_data; -static uint8_t remcomOutBuffer[BUFMAX] bulk_data; - -static const char hexchars[]="0123456789abcdef"; - -/* Convert ch from a hex digit to an int */ - -static int hex(unsigned char ch) -{ - if (ch >= 'a' && ch <= 'f') - return ch-'a'+10; - if (ch >= '0' && ch <= '9') - return ch-'0'; - if (ch >= 'A' && ch <= 'F') - return ch-'A'+10; - return -1; -} - -/* scan for the sequence $<data>#<checksum> */ - -unsigned char *getpacket(void) -{ - unsigned char *buffer = &remcomInBuffer[0]; - unsigned char checksum; - unsigned char xmitcsum; - int count; - char ch; - - while (1) { - /* wait around for the start character, ignore all other characters */ - while ((ch = getDebugChar ()) != '$') - ; - -retry: - checksum = 0; - xmitcsum = -1; - count = 0; - - /* now, read until a # or end of buffer is found */ - while (count < BUFMAX - 1) { - ch = getDebugChar (); - if (ch == '$') - goto retry; - if (ch == '#') - break; - checksum = checksum + ch; - buffer[count] = ch; - count = count + 1; - } - buffer[count] = 0; - - if (ch == '#') { - ch = getDebugChar (); - xmitcsum = hex (ch) << 4; - ch = getDebugChar (); - xmitcsum += hex (ch); - - if (checksum != xmitcsum) { - putDebugChar ('-'); /* failed checksum */ - } else { - putDebugChar ('+'); /* successful transfer */ - - /* if a sequence char is present, reply the sequence ID */ - if (buffer[2] == ':') { - putDebugChar (buffer[0]); - putDebugChar (buffer[1]); - - return &buffer[3]; - } - - return &buffer[0]; - } - } - } -} - -/* send the packet in buffer. */ - -static void putpacket(uint8_t *buffer) -{ - unsigned char checksum; - int count; - unsigned char ch; - - /* $<packet info>#<checksum>. */ - do { - putDebugChar('$'); - checksum = 0; - count = 0; - - while ((ch = buffer[count]) != 0) { - putDebugChar(ch); - checksum += ch; - count += 1; - } - - putDebugChar('#'); - putDebugChar(hexchars[checksum >> 4]); - putDebugChar(hexchars[checksum & 0xf]); - - } while (getDebugChar() != '+'); -} - -/* Indicate to caller of mem2hex or hex2mem that there has been an - error. */ -volatile int mem_err = 0; - -/* Convert the memory pointed to by mem into hex, placing result in buf. - * Return a pointer to the last char put in buf (null), in case of mem fault, - * return 0. - */ - -static uint8_t * mem2hex(const void *mem_, uint8_t *buf, int count) -{ - const unsigned char *mem = mem_; - unsigned char ch; - - mem_err = 0; - while (count-- > 0) { -#ifdef __XTENSA__ - unsigned long v; - unsigned long addr = (unsigned long)mem; - asm volatile ("_l32i %0, %1, 0\n" - : "=r"(v) - : "r"(addr & ~3) - : "memory"); - ch = v >> (addr & 3) * 8; -#endif - mem++; - if (mem_err) - return NULL; - *buf++ = hexchars[ch >> 4]; - *buf++ = hexchars[ch & 0xf]; - } - - *buf = 0; - - return buf; -} - -/* convert the hex array pointed to by buf into binary to be placed in mem - * return a pointer to the character AFTER the last byte written */ - -static uint8_t * hex2mem(const uint8_t *buf, void *mem_, int count) -{ - uint8_t *mem = mem_; - int i; - uint8_t ch; - - if ((unsigned long)mem >= 0xece80000) - return NULL; - - mem_err = 0; - for (i=0; i<count; i++) { - ch = hex(*buf++) << 4; - ch |= hex(*buf++); -#ifdef __XTENSA__ - unsigned long tmp; - unsigned long addr = (unsigned long)mem; - asm volatile ("_l32i %0, %1, 0\n" - "and %0, %0, %2\n" - "or %0, %0, %3\n" - "_s32i %0, %1, 0\n" - "dhwb %1, 0\n" - "ihi %1, 0\n" - : "=r"(tmp) - : "r"(addr & ~3), "r"(0xffffffff ^ (0xff << (addr & 3) * 8)), "r"(ch << (addr & 3) * 8) - : "memory"); -#endif - mem++; - if (mem_err) - return NULL; - } - - return mem; -} - -/* - * While we find nice hex chars, build an int. - * Return number of chars processed. - */ - -static int hexToInt(uint8_t **ptr, int *intValue) -{ - int numChars = 0; - int hexValue; - - *intValue = 0; - - while (**ptr) { - hexValue = hex(**ptr); - if (hexValue < 0) - break; - - *intValue = (*intValue << 4) | hexValue; - numChars ++; - - (*ptr)++; - } - - return (numChars); -} - -static inline int test_bit(const uint8_t *p, int bit) -{ - return (p[bit / 8] >> (bit & 0x7)) & 1; -} -static inline int set_bit(uint8_t *p, int bit) -{ - return (p[bit / 8] |= 1u << (bit & 0x7)); -} - -static inline void mark_read(int sr) -{ - set_bit(sregs_read, sr); -} -static inline int is_read(int sr) -{ - return test_bit(sregs_read, sr); -} -static inline void mark_mod(int sr) -{ - set_bit(sregs_mod, sr); -} -static inline int is_mod(int sr) -{ - return test_bit(sregs_mod, sr); -} -static inline void mark_late(int sr) -{ - set_bit(sregs_late, sr); -} -static inline int is_late(int sr) -{ - return test_bit(sregs_late, sr); -} - -static void read_sr(int sr) -{ - if (!is_read(sr)) { -#ifdef __XTENSA__ - uint32_t val; - asm volatile ("movi a3, 1f + 1\n" - "s8i %1, a3, 0\n" - "dhwb a3, 0\n" - "ihi a3, 0\n" - "isync\n" - "1:\n" - "rsr %0, lbeg\n" - : "=r"(val) - : "r"(sr) - : "a3", "memory"); - sregs[sr] = val; -#endif - mark_read(sr); - } -} - -static void write_sr(int sr) -{ -#ifdef __XTENSA__ - asm volatile ("movi a3, 1f + 1\n" - "s8i %1, a3, 0\n" - "dhwb a3, 0\n" - "ihi a3, 0\n" - "isync\n" - "1:\n" - "wsr %0, lbeg\n" - : - : "r"(sregs[sr]), "r"(sr) - : "a3", "memory"); -#endif -} - -static void restore_sr(void) -{ - int i; - for (i = 0; i < 256; ++i) - if (is_mod(i) && !is_late(i)) - write_sr(i); -} - -extern void *_xtos_exc_handler_table[]; -void fault_handler(void); -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) - -void handle_exception(void) -{ - int sigval = 0; - int addr; - int length; - uint8_t *ptr; - unsigned i; - const unsigned windowbase = 4 * sregs[WINDOWBASE]; - uint8_t stop_status[4] = "Sxx"; -#ifdef LIBC_LEVEL1_HANDLER - static const int cause[] = { - EXCCAUSE_LOAD_STORE_ERROR, - EXCCAUSE_LOAD_STORE_DATA_ERROR, - EXCCAUSE_LOAD_STORE_ADDR_ERROR, - EXCCAUSE_DTLB_MISS, - EXCCAUSE_DTLB_MULTIHIT, - EXCCAUSE_LOAD_PROHIBITED, - EXCCAUSE_STORE_PROHIBITED, - }; - _xtos_handler handler[sizeof(cause) / sizeof(cause[0])]; - - for (i = 0; i < ARRAY_SIZE(cause); ++i) { - handler[i] = _xtos_exc_handler_table[cause[i]]; - _xtos_exc_handler_table[cause[i]] = fault_handler; - } -#endif - memcpy(sregs_read, sregs_late, sizeof(sregs_read)); - memset(sregs_mod, 0, sizeof(sregs_mod)); - - sigval = 5; - stop_status[1] = hexchars[sigval >> 4]; - stop_status[2] = hexchars[sigval & 0xf]; - - if (sregs[DEBUGCAUSE] & DEBUGCAUSE_ICOUNT_MASK) { - sregs[ICOUNTLEVEL] = 0; - mark_mod(ICOUNTLEVEL); - } - putpacket(stop_status); - - while (1) { - remcomOutBuffer[0] = 0; - - ptr = getpacket(); - switch (*ptr++) { - case '?': - memcpy(remcomOutBuffer, stop_status, sizeof(stop_status)); - break; - - case 'c': /* cAA..AA Continue at address AA..AA(optional) */ - /* try to read optional parameter, pc unchanged if no parm */ - - if (hexToInt(&ptr, &addr)) - sregs[DEBUG_PC] = addr; - goto out; - - case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ - /* Try to read %x,%x. */ - - if (hexToInt(&ptr, &addr) && *ptr++ == ',' && - hexToInt(&ptr, &length)) { - if (mem2hex((void *)addr, remcomOutBuffer, length)) - break; - - strcpy((char *)remcomOutBuffer, "E03"); - } else { - strcpy((char *)remcomOutBuffer, "E01"); - } - break; - - case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ - /* Try to read '%x,%x:'. */ - - if (hexToInt(&ptr, &addr) && *ptr++ == ',' && - hexToInt(&ptr, &length) && *ptr++ == ':') { - if (hex2mem(ptr, (void *)addr, length)) - strcpy((char *)remcomOutBuffer, "OK"); - else - strcpy((char *)remcomOutBuffer, "E03"); - } else { - strcpy((char *)remcomOutBuffer, "E02"); - } - break; - - case 'p': /* pAA..AA read register number AA..AA */ - if (hexToInt(&ptr, &addr)) { - if (addr < 0x10) { /* read address register in the current window */ - mem2hex(aregs + addr, remcomOutBuffer, 4); - } else if (addr == 0x20) { /* read PC */ - mem2hex(sregs + DEBUG_PC, remcomOutBuffer, 4); - } else if (addr >= 0x100 && addr < 0x100 + XCHAL_NUM_AREGS) { /* read address register by absolute index */ - mem2hex(aregs + ((addr - windowbase) & 0xff), remcomOutBuffer, 4); - } else if (addr >= 0x200 && addr < 0x300) { /* read special register */ - addr &= 0xff; - read_sr(addr); - mem2hex(sregs + addr, remcomOutBuffer, 4); - } else if (addr >= 0x300 && addr < 0x400) { /* TODO read user register */ - strcpy((char *)remcomOutBuffer, "deadbabe"); - } else { /* unexpected register number */ - strcpy((char *)remcomOutBuffer, "E00"); - } - } - break; - - case 'P': /* PAA..AA=VV..VV Set register number AA..AA to a value VV..VV */ - if (hexToInt(&ptr, &addr) && *(ptr++) == '=') { - int ok = 1; - - if (addr < 0x10) { - hex2mem(ptr, aregs + addr, 4); - } else if (addr == 0x20) { - hex2mem(ptr, sregs + DEBUG_PC, 4); - } else if (addr >= 0x100 && addr < 0x100 + XCHAL_NUM_AREGS) { - hex2mem(ptr, aregs + ((addr - windowbase) & 0xff), 4); - } else if (addr >= 0x200 && addr < 0x300) { - addr &= 0xff; - hex2mem(ptr, sregs + addr, 4); - mark_read(addr); - mark_mod(addr); - } else { - ok = 0; - strcpy((char *)remcomOutBuffer, "E00"); - } - if (ok) - strcpy((char *)remcomOutBuffer, "OK"); - } - break; - - case 'q': /* generic query */ - if (strncmp((char *)ptr, "Supported", 9) == 0) - strcpy((char *)remcomOutBuffer, "PacketSize=100"); /* must match BUFMAX */ - break; - - case 's': /* s[AA..AA] Single step */ - if (hexToInt(&ptr, &addr)) - sregs[DEBUG_PC] = addr; - sregs[ICOUNT] = 0xfffffffe; - mark_mod(ICOUNT); - sregs[ICOUNTLEVEL] = XCHAL_DEBUGLEVEL; - mark_mod(ICOUNTLEVEL); - goto out; - - case 'Z': /* insert HW breakpoint*/ - switch (*ptr++) { - case '1': - read_sr(IBREAKENABLE); - if (*ptr++ == ',' && hexToInt(&ptr, &addr) && - *ptr++ == ',' && hexToInt(&ptr, &length) && - *ptr == 0) { - for (i = 0; i < XCHAL_NUM_IBREAK; ++i) { - if (!(sregs[IBREAKENABLE] & (1 << i)) || - sregs[IBREAKA + i] == addr) { - sregs[IBREAKA + i] = addr; - mark_mod(IBREAKA + i); - sregs[IBREAKENABLE] |= (1 << i); - mark_mod(IBREAKENABLE); - break; - } - } - if (i == XCHAL_NUM_IBREAK) - strcpy((char *)remcomOutBuffer, "E02"); - else - strcpy((char *)remcomOutBuffer, "OK"); - } else { - strcpy((char *)remcomOutBuffer, "E01"); - } - break; - } - break; - - case 'z': /* remove HW breakpoint */ - switch (*ptr++) { - case '1': - read_sr(IBREAKENABLE); - if (*ptr++ == ',' && hexToInt(&ptr, &addr) && - *ptr++ == ',' && hexToInt(&ptr, &length)) { - for (i = 0; i < XCHAL_NUM_IBREAK; ++i) { - read_sr(IBREAKA + i); - if (sregs[IBREAKENABLE] & (1 << i) && - sregs[IBREAKA + i] == addr) { - sregs[IBREAKENABLE] &= ~(1 << i); - mark_mod(IBREAKENABLE); - break; - } - } - if (i == XCHAL_NUM_IBREAK) - strcpy((char *)remcomOutBuffer, "E02"); - else - strcpy((char *)remcomOutBuffer, "OK"); - } else { - strcpy((char *)remcomOutBuffer, "E01"); - } - break; - } - break; - } - - /* reply to the request */ - putpacket(remcomOutBuffer); - } -out: -#ifdef LIBC_LEVEL1_HANDLER - for (i = 0; i < ARRAY_SIZE(cause); ++i) { - _xtos_exc_handler_table[cause[i]] = handler[i]; - } -#endif - restore_sr(); -} - -void init_gdbstub(void) -{ - mark_late(LBEG); - mark_late(LEND); - mark_late(LCOUNT); - mark_late(SAR); - mark_late(WINDOWBASE); - mark_late(WINDOWSTART); - mark_late(DEBUG_PC); - mark_late(EXCSAVE_1); - mark_late(PS); - mark_late(EXCCAUSE); - mark_late(DEBUGCAUSE); - mark_late(EXCVADDR); -#ifdef __XTENSA__ - init_debug_comm(); - init_debug_entry(); -#endif -} diff --git a/hifi/xaf/hifi-dpf/core/util/gdbstub/xtensa-defs.h b/hifi/xaf/hifi-dpf/core/util/gdbstub/xtensa-defs.h deleted file mode 100644 index 6ba485ff..00000000 --- a/hifi/xaf/hifi-dpf/core/util/gdbstub/xtensa-defs.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef XTENSA_DEFS_H -#define XTENSA_DEFS_H - -#include <xtensa/specreg.h> -#include <xtensa/config/core-isa.h> -#include <xtensa/corebits.h> - -#define _AREG0 256 - -#define STACK_SIZE 1024 -#define DEBUG_PC (EPC + XCHAL_DEBUGLEVEL) -#define DEBUG_EXCSAVE (EXCSAVE + XCHAL_DEBUGLEVEL) -#define DEBUG_PS (EPS + XCHAL_DEBUGLEVEL) - -#endif /* XTENSA_DEFS_H */ diff --git a/hifi/xaf/hifi-dpf/core/util/mutex.c b/hifi/xaf/hifi-dpf/core/util/mutex.c deleted file mode 100644 index d62a6a17..00000000 --- a/hifi/xaf/hifi-dpf/core/util/mutex.c +++ /dev/null @@ -1,156 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * mutex.c - * - * Implementation of non-robust Szymanski linear-waiting algorithm. Types of - * failures tolerated by Szymanski's "robust" algorithm are not specific for - * Xtensa DSP cluster and therefore more lightweight version of the algorithm - * is used. FIFO servicing property is of low importance, and faster/smaller - * version with linear-wait property is preferable. - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Local constants definitions - ******************************************************************************/ - -/* ...communication variables */ -#define __M_A (1 << 0) -#define __M_W (1 << 1) -#define __M_S (1 << 2) - -/* ...process states (updated atomically) */ -#define M_PASSIVE (0) -#define M_ENTRY (__M_A) -#define M_INSIDE (__M_W) -#define M_TRANSIENT (__M_S | __M_W) -#define M_EXIT (__M_S) - -/* ...total number of cores */ -#define M_N XF_CFG_CORES_NUM - -/* ...do not compile the code if there is just a single core */ -#if M_N > 1 -/******************************************************************************* - * Entry points - ******************************************************************************/ - -void mutex_lock(u32 i) -{ - u32 j; - - /* ...p1: i-th core goes into "entry" state (aws = true,false,false) */ - MUTEX_SHARED_WRITE(i, M_ENTRY); - - /* ...p2: wait all processes have sj=false (waiting room door is open) */ - for (j = 0; j < M_N; j++) - { - /* ...wait until sj = false */ - while (MUTEX_SHARED_READ(j) & __M_S) (void) 0; - } - - /* ...p3: i-th core enters "inside" state (aws = false,true,false) */ - MUTEX_SHARED_WRITE(i, M_INSIDE); - -p4: - /* ...p4: wait in "inside" state */ - for (j = 0; j < M_N; j++) - { - /* ...p5: check if any of the cores appears is in "entry" state (aj=true) */ - if (MUTEX_SHARED_READ(j) & __M_A) - { - /* ...p5: found core in "entry" state (j < n); wait until it enters waiting room */ - goto p7; - } - } - - /* ...p6: j == n; enter into "transient" state (ai=false, wi=true, si=true) */ - MUTEX_SHARED_WRITE(i, M_TRANSIENT); - - /* ...p6.1: check for any core appearing in "entry" room */ - for (j = 0; j < M_N; j++) - { - if (MUTEX_SHARED_READ(j) & __M_A) - { - /* ...p6.2: found core in "entry" state (j < n) */ - MUTEX_SHARED_WRITE(i, M_INSIDE); - - /* ...back of to the "inside" state */ - goto p7; - } - } - - /* ...p6.3: no cores in "entry" room (j == n); go to "exit" state (ai=false, wi=false, si=true) */ - MUTEX_SHARED_WRITE(i, M_EXIT); - - /* ...p6.4: allow all cores to leave "transient" state (i.e. switch to "exit") */ - for (j = 0; j < M_N; j++) - { - while (MUTEX_SHARED_READ(j) & __M_W) (void) 0; - } - - goto p9; - -p7: - /* ...j < n condition is met; find any cores in "inside" state (wj = true, sj = false) */ - for (j = 0; j < M_N; j++) - { - /* ...check if the core is in "exit" state */ - if (MUTEX_SHARED_READ(j) == M_EXIT) - { - /* ...p8.1: different core is a leader; go to "exit" state (ai=false, wi=false, si=true) */ - MUTEX_SHARED_WRITE(i, M_EXIT); - - goto p9; - } - } - - /* ...wait in "inside" state while all transients settle */ - goto p4; - -p9: - /* ...p9: i-th core is in "exit" state; enter critical section in accordance with numbering */ - for (j = 0; j < i; j++) - { - /* ...wait until core with lower number in "inside"/"transient"/"exit" states leaves */ - while (MUTEX_SHARED_READ(j) & (__M_W | __M_S)) (void) 0; - } - - /* ...critical section entered */ -} - -/******************************************************************************* - * mutex_unlock - * - * Release multi-core mutex - ******************************************************************************/ - -void mutex_unlock(u32 i) -{ - /* ...enter into "passive" state (ai=false, wi=false, si=false) */ - MUTEX_SHARED_WRITE(i, M_PASSIVE); -} - -#endif /* M_N > 1 */ diff --git a/hifi/xaf/hifi-dpf/core/util/rbtree.c b/hifi/xaf/hifi-dpf/core/util/rbtree.c deleted file mode 100644 index 740e0255..00000000 --- a/hifi/xaf/hifi-dpf/core/util/rbtree.c +++ /dev/null @@ -1,842 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * rbtree.c - * - * Red-black tree library - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Macros definitions - ******************************************************************************/ - -/* ...node color */ -#define RB_RED (1) -#define RB_BLK (0) - -/* ...pointer to parent node */ -#define RB_PARENT(tree, node) ((node)->parent) - -/* ...pointer to left child node */ -#define RB_LEFT(tree, node) ((node)->left) - -/* ...pointer to right child node */ -#define RB_RIGHT(tree, node) ((node)->right) - -/* ...pointer to right child node */ -#define RB_COLOR(tree, node) ((node)->color & 1) - -/* ...check if node is black */ -#define RB_IS_BLACK(tree, node) (!((node)->color & RB_RED)) - -/* ...root node index of the tree - can be simplified? */ -#define RB_ROOT(tree) RB_LEFT((tree), &(tree)->root) - -/* ...empty node */ -#define RB_NULL(tree) (&(tree)->root) - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -#define RB_SET_P(t, n, p) \ - ({ (n)->parent = (p); }) - -#define RB_SET_L(t, n, l) \ - ({ (n)->left = (l); }) - -#define RB_SET_R(t, n, r) \ - ({ (n)->right = (r); }) - -#define RB_SET_C(t, n, c) \ - RB_SET_C_##c((t), (n)) - -#define RB_SET_C_RB_BLK(t, n) \ - ({ (n)->color &= ~1; }) - -#define RB_SET_C_RB_RED(t, n) \ - ({ (n)->color |= 1; }) - -#define RB_SET_P_C(t, n, p, c) \ - ({ (n)->parent = (p); RB_SET_C_##c(t, n); }) - -#define RB_SET_P_L(t, n, p, l) \ - ({ (n)->parent = (p); (n)->left = (l); }) - -#define RB_SET_P_L_C(t, n, p, l, c) \ - ({ (n)->parent = (p); (n)->left = (l); RB_SET_C_##c(t, n); }) - -#define RB_SET_P_R(t, n, p, r) \ - ({ (n)->parent = (p); (n)->right = (r); }) - -#define RB_SET_P_R_C(t, n, p, r, c) \ - ({ (n)->parent = (p); (n)->right = (r); RB_SET_C_##c(t, n); }) - -#define RB_SET_P_L_R(t, n, p, l, r) \ - ({ (n)->parent = (p); (n)->left = (l); (n)->right = (r); }) - -#define RB_SET_P_L_R_C(t, n, p, l, r, c)\ - ({ (n)->parent = (p); (n)->left = (l); (n)->right = (r); RB_SET_C_##c(t, n); }) - -#define RB_SET_ROOT(t, n) \ - RB_SET_L((t), &(t)->root, (n)) - -/******************************************************************************* - * RB-tree functions - ******************************************************************************/ - -/******************************************************************************* - * rb_first, rb_last - * - * Return pointer to first/last item in the tree - ******************************************************************************/ - -rb_idx_t rb_first(rb_tree_t *tree) -{ - rb_idx_t p_idx, t_idx; - - if ((p_idx = RB_ROOT(tree)) != RB_NULL(tree)) - { - /* ...find left-most item in non-empty tree */ - while ((t_idx = RB_LEFT(tree, p_idx)) != RB_NULL(tree)) - p_idx = t_idx; - } - - return p_idx; -} - -rb_idx_t rb_last(rb_tree_t *tree) -{ - rb_idx_t p_idx, t_idx; - - if ((p_idx = RB_ROOT(tree)) != RB_NULL(tree)) - { - /* ...find right-most item in non-empty tree */ - while ((t_idx = RB_RIGHT(tree, p_idx)) != RB_NULL(tree)) - p_idx = t_idx; - } - - return p_idx; -} - -/******************************************************************************* - * rb_next, rb_prev - * - * Return next / previous in-order item in the tree - ******************************************************************************/ - -rb_idx_t rb_next(rb_tree_t *tree, rb_idx_t n_idx) -{ - rb_idx_t p_idx, c_idx, t_idx; - - /* ...if we have any right children, process them */ - if ((c_idx = RB_RIGHT(tree, n_idx)) != RB_NULL(tree)) - { - /* ...descent to the left-most node starting from right child */ - while ((t_idx = RB_LEFT(tree, c_idx)) != RB_NULL(tree)) - c_idx = t_idx; - return c_idx; - } - - /* ...no right children; ascend to our parent while we are right child */ - while ((p_idx = RB_PARENT(tree, n_idx)) != RB_NULL(tree)) - { - /* ...as soon as "n" is a left child, return "p" */ - if (n_idx == RB_RIGHT(tree, p_idx)) - n_idx = p_idx; - else - return p_idx; - } - - /* ...we were right-most child */ - return p_idx; -} - -rb_idx_t rb_prev(rb_tree_t *tree, rb_idx_t n_idx) -{ - rb_idx_t p_idx, c_idx, t_idx; - - /* ...if we have any left children, process them */ - if ((c_idx = RB_LEFT(tree, n_idx)) != RB_NULL(tree)) - { - /* ...descent to the right-most node starting from left child */ - while ((t_idx = RB_RIGHT(tree, c_idx)) != RB_NULL(tree)) - c_idx = t_idx; - return c_idx; - } - - /* ...no left children; ascend to our parent while we are left child */ - while ((p_idx = RB_PARENT(tree, n_idx)) != RB_NULL(tree)) - { - /* ...as soon as "n" is a right child, return "p" */ - if (n_idx == RB_LEFT(tree, p_idx)) - n_idx = p_idx; - else - return p_idx; - } - - /* ...we were left-most child */ - return p_idx; -} - -/******************************************************************************* - * rb_init - * - * Initialize rb-tree structure - ******************************************************************************/ - -void rb_init(rb_tree_t *tree) -{ - /* ...initialize sentinel node of the empty tree */ - RB_SET_P_L_R_C(tree, &tree->root, RB_NULL(tree), RB_NULL(tree), RB_NULL(tree), RB_BLK); -} - -/******************************************************************************* - * rb_insert - * - * Insert new item into RB-tree. Returns non-zero node index on success - ******************************************************************************/ - -/* ...internal tree balancing function */ -static void __rb_insert_balance(rb_tree_t *tree, rb_idx_t n_idx, rb_idx_t p_idx) -{ - rb_idx_t u_idx, g_idx, t_idx, cl_idx, cr_idx; - -rebalance: - - /*************************************************************************** - * Trivial case #1 - N (red) is a root - **************************************************************************/ - - if (p_idx == RB_NULL(tree)) - { - RB_SET_C(tree, n_idx, RB_BLK); - goto root; - } - - /*************************************************************************** - * Trivial case #2 - P is black - **************************************************************************/ - - if (RB_IS_BLACK(tree, p_idx)) - goto done; - - /*************************************************************************** - * Complex cases - P is red, N is red - **************************************************************************/ - - /* ...grandparent must exist and be black */ - g_idx = RB_PARENT(tree, p_idx); - if (p_idx == RB_LEFT(tree, g_idx)) - { - /* ...we are left grandchild; get uncle (if it exists) */ - u_idx = RB_RIGHT(tree, g_idx); - - /* ...if U is read, we have conditions of case #3 */ - if (!RB_IS_BLACK(tree, u_idx)) - goto case3; - - /* ...we will need grand-grand-parent later */ - t_idx = RB_PARENT(tree, g_idx); - - /* ...U is black/null; if we are LL grandchild, we have case #5 */ - if (n_idx == RB_LEFT(tree, p_idx)) - goto case5_ll; - - /* ...N is RL grandchild of G; case #4 */ - goto case4_rl; - } - else - { - /* ...we are right grandchild; get uncle (if it exists) */ - u_idx = RB_LEFT(tree, g_idx); - - /* ...if U is read, we have conditions of case #3 */ - if (!RB_IS_BLACK(tree, u_idx)) - goto case3; - - /* ...we will need grand-grand-parent later */ - t_idx = RB_PARENT(tree, g_idx); - - /* ...U is black/null; if we are RR grandchild, we have case #5 */ - if (n_idx == RB_RIGHT(tree, p_idx)) - goto case5_rr; - - /* ...N is LR grandchild of G; case #4 */ - goto case4_lr; - } - -case4_rl: - - /*************************************************************************** - * Case #4 - P is red, U is black, N is red RL grandchild of G. We will do - * two tree rotations - first the one described in case #4, second is the - * one described in case #5 (as have conditions for case #5(LL) with P and - * N changing roles - **************************************************************************/ - - cl_idx = RB_LEFT(tree, n_idx), cr_idx = RB_RIGHT(tree, n_idx); - RB_SET_P_L_R_C(tree, n_idx, t_idx, p_idx, g_idx, RB_BLK); - RB_SET_P_R(tree, p_idx, n_idx, cl_idx); - RB_SET_P(tree, cl_idx, p_idx); - RB_SET_P_L_C(tree, g_idx, n_idx, cr_idx, RB_RED); - RB_SET_P(tree, cr_idx, g_idx); - - /* ...new root of subtree is N; adjust T pointer */ - goto case5_xx; - -case4_lr: - - /*************************************************************************** - * Case #4 - P is red, U is black, N is red LR grandchild of G. We will do - * two tree rotations - first the one described in case #4, second is the - * one described in case #5 (as have conditions for case #5(RR) with P and - * N changing roles - **************************************************************************/ - - cl_idx = RB_LEFT(tree, n_idx), cr_idx = RB_RIGHT(tree, n_idx); - RB_SET_P_L_R_C(tree, n_idx, t_idx, g_idx, p_idx, RB_BLK); - RB_SET_P_L(tree, p_idx, n_idx, cr_idx); - RB_SET_P(tree, cr_idx, p_idx); - RB_SET_P_R_C(tree, g_idx, n_idx, cl_idx, RB_RED); - RB_SET_P(tree, cl_idx, g_idx); - - /* ...new root of the subtree is N; adjust T pointer */ - goto case5_xx; - -case5_ll: - - /*************************************************************************** - * Case #5: N is LL grandchild of P; N and P red, G and U black - **************************************************************************/ - - cr_idx = RB_RIGHT(tree, p_idx); - RB_SET_P_L_C(tree, g_idx, p_idx, cr_idx, RB_RED); - RB_SET_P(tree, cr_idx, g_idx); - RB_SET_P_R_C(tree, p_idx, t_idx, g_idx, RB_BLK); - - /* ...new root of the subtree is P; relabel and adjust T pointer */ - n_idx = p_idx; - goto case5_xx; - -case5_rr: - - /*************************************************************************** - * Case #5: N is RR grandchild of P; N and P red, G and U black - **************************************************************************/ - - cl_idx = RB_LEFT(tree, p_idx); - RB_SET_P_R_C(tree, g_idx, p_idx, cl_idx, RB_RED); - RB_SET_P(tree, cl_idx, g_idx); - RB_SET_P_L_C(tree, p_idx, t_idx, g_idx, RB_BLK); - - /* ...new root of the subtree is P; relabel and adjust T pointer */ - n_idx = p_idx; - goto case5_xx; - -case5_xx: - - /* ...N is a (black) root of subtree; check if it is a root of tree as well */ - if (t_idx == RB_NULL(tree)) - goto root; - else if (g_idx == RB_LEFT(tree, t_idx)) - RB_SET_L(tree, t_idx, n_idx); - else - RB_SET_R(tree, t_idx, n_idx); - - goto done; - -case3: - - /*************************************************************************** - * Case #3 - P and U are red, G is black - **************************************************************************/ - - RB_SET_C(tree, p_idx, RB_BLK); - RB_SET_C(tree, u_idx, RB_BLK); - RB_SET_C(tree, g_idx, RB_RED); - - /* ...rebalance the tree for a G */ - n_idx = g_idx, p_idx = RB_PARENT(tree, g_idx); - goto rebalance; - -root: - /* ...adjust root pointer of the tree */ - RB_SET_ROOT(tree, n_idx); - -done: - /* ...tree is balanced */ - return; -} - -/* ...high-level API function */ -void rb_insert(rb_tree_t *tree, rb_idx_t n_idx, rb_idx_t p_idx) -{ - if (p_idx == RB_NULL(tree)) - { - /* ...set black root node */ - RB_SET_P_L_R_C(tree, n_idx, p_idx, p_idx, p_idx, RB_BLK); - - /* ...tree consists of the only root node; is balanced */ - RB_SET_ROOT(tree, n_idx); - } - else - { - /* ...create new node - set parent pointer and paint red */ - RB_SET_P_L_R_C(tree, n_idx, p_idx, RB_NULL(tree), RB_NULL(tree), RB_RED); - - /* ...and rebalance the tree */ - __rb_insert_balance(tree, n_idx, p_idx); - } -} - -/******************************************************************************* - * rb_delete - * - * Remove item from RB-key (by key). Returns zero on success - ******************************************************************************/ - -/* ...internal tree balancing function */ -static void __rb_delete_rebalance(rb_tree_t *tree, rb_idx_t p_idx) -{ - rb_idx_t n_idx, s_idx, sl_idx, sr_idx, g_idx, c_idx, cl_idx, cr_idx; - - /* ...initialize rebalancing procedure with null-child of P */ - n_idx = RB_NULL(tree); - -rebalance: - - /* ...save grand-parent pointer (may be null) */ - g_idx = RB_PARENT(tree, p_idx); - - /*************************************************************************** - * Check for complex cases - **************************************************************************/ - - if (n_idx == RB_LEFT(tree, p_idx)) - { - /* ...N is left child; get sibling (must exist) and its children */ - s_idx = RB_RIGHT(tree, p_idx); - sl_idx = RB_LEFT(tree, s_idx); - sr_idx = RB_RIGHT(tree, s_idx); - - /* ...if S is black, test for conditions 3,4,5,6; otherwise - case 2 */ - if (RB_IS_BLACK(tree, s_idx)) - goto test3_l; - else - goto case2_l; - } - else - { - /* ...N is right child; get sibling (must exist) and its children */ - s_idx = RB_LEFT(tree, p_idx); - sl_idx = RB_LEFT(tree, s_idx); - sr_idx = RB_RIGHT(tree, s_idx); - - /* ...if S is black, test for conditions 3,4,5,6; otherwise - case 2 */ - if (RB_IS_BLACK(tree, s_idx)) - goto test3_r; - else - goto case2_r; - } - -case2_l: - - /*************************************************************************** - * Case #2: N is a left child of P; S is red - **************************************************************************/ - - c_idx = sl_idx; - RB_SET_P_L_C(tree, s_idx, g_idx, p_idx, RB_BLK); - RB_SET_P_R_C(tree, p_idx, s_idx, c_idx, RB_RED); - RB_SET_P(tree, c_idx, p_idx); - - /* ...S is new root of subtree, Sl(C) is new sibling of N; update G */ - goto case2_x; - -case2_r: - - /*************************************************************************** - * Case #2: N is a right child of P; S is red - **************************************************************************/ - - c_idx = sr_idx; - RB_SET_P_R_C(tree, s_idx, g_idx, p_idx, RB_BLK); - RB_SET_P_L_C(tree, p_idx, s_idx, c_idx, RB_RED); - RB_SET_P(tree, c_idx, p_idx); - - /* ...S is new root of subtree, Sr(C) is new sibling of N; update G */ - goto case2_x; - -case2_x: - - /* ...check if S is becoming new (black) root of the tree */ - if (g_idx == RB_NULL(tree)) - RB_SET_ROOT(tree, s_idx); - else if (p_idx == RB_LEFT(tree, g_idx)) - RB_SET_L(tree, g_idx, s_idx); - else - RB_SET_R(tree, g_idx, s_idx); - - /* ...relabel new N's grandparent (now S) as G and new sibling (now C) as S */ - g_idx = s_idx, s_idx = c_idx; - sl_idx = RB_LEFT(tree, s_idx); - sr_idx = RB_RIGHT(tree, s_idx); - - /* ...N is still one of P's children; select proper side */ - if (n_idx == RB_LEFT(tree, p_idx)) - goto test3_l; - else - goto test3_r; - -test3_l: - - /*************************************************************************** - * Test for cases 3,4,5,6; P is any, S is black. N is left child of P - **************************************************************************/ - - if (!RB_IS_BLACK(tree, sr_idx)) - /* ...Sr is red, Sl of any color; conditions for case #6 are met */ - goto case6_l; - else if (!RB_IS_BLACK(tree, sl_idx)) - /* ...Sr is black and Sl is red; conditions for case #5 are met */ - goto case5_l; - else if (RB_IS_BLACK(tree, p_idx)) - /* ...Sl and Sr are of the same (black) color and P is black */ - goto case3; - else - /* ...Sl and Sr are of the same (black) color and P is red */ - goto case4; - -test3_r: - - /*************************************************************************** - * Test for cases 3,4,5,6; P is any, S is black. N is right child of P - **************************************************************************/ - - if (!RB_IS_BLACK(tree, sl_idx)) - /* ...Sl is red, Sr of any color; conditions for case #6 are met */ - goto case6_r; - else if (!RB_IS_BLACK(tree, sr_idx)) - /* ...Sl is black and Sr is red; conditions for case #5 are met */ - goto case5_r; - else if (RB_IS_BLACK(tree, p_idx)) - /* ...Sl and Sr are of the same (black) color and P is black */ - goto case3; - else - /* ...Sl and Sr are of the same (black) color and P is red */ - goto case4; - -case3: - - /*************************************************************************** - * Case #3: N, P, S, Sl and Sr are black - **************************************************************************/ - - RB_SET_C(tree, s_idx, RB_RED); - - /* ...and rebalance the tree for parent */ - n_idx = p_idx, p_idx = RB_PARENT(tree, p_idx); - - if (p_idx == RB_NULL(tree)) - goto done; - else - goto rebalance; - -case4: - - /*************************************************************************** - * Case #4: N and S are black, P is red, Sl and Sr are all black - **************************************************************************/ - - RB_SET_C(tree, s_idx, RB_RED); - RB_SET_C(tree, p_idx, RB_BLK); - - goto done; - -case5_l: - /*************************************************************************** - * Case #5: S is black, Sl is red, Sr is black; N is left child of P. We - * have two subsequent transformations (case #5 and case #6) combined - **************************************************************************/ - - cl_idx = RB_LEFT(tree, sl_idx); - cr_idx = RB_RIGHT(tree, sl_idx); - - if (RB_IS_BLACK(tree, p_idx)) - RB_SET_P_L_R_C(tree, sl_idx, g_idx, p_idx, s_idx, RB_BLK); - else - RB_SET_P_L_R_C(tree, sl_idx, g_idx, p_idx, s_idx, RB_RED); - - RB_SET_P_R_C(tree, p_idx, sl_idx, cl_idx, RB_BLK); - RB_SET_P(tree, cl_idx, p_idx); - RB_SET_P_L(tree, s_idx, sl_idx, cr_idx); - RB_SET_P(tree, cr_idx, s_idx); - - /* ...relabel new root as S (for common processing in case #6) */ - s_idx = sl_idx; - goto case6_x; - -case5_r: - /*************************************************************************** - * Case #5: S is black, Sr is red, Sl is black; N is right child of P. We - * have two subsequent transformations (case #5 and case #6) combined - **************************************************************************/ - - cl_idx = RB_LEFT(tree, sr_idx); - cr_idx = RB_RIGHT(tree, sr_idx); - - if (RB_IS_BLACK(tree, p_idx)) - RB_SET_P_L_R_C(tree, sr_idx, g_idx, s_idx, p_idx, RB_BLK); - else - RB_SET_P_L_R_C(tree, sr_idx, g_idx, s_idx, p_idx, RB_RED); - - RB_SET_P_L_C(tree, p_idx, sr_idx, cr_idx, RB_BLK); - RB_SET_P(tree, cr_idx, p_idx); - RB_SET_P_R(tree, s_idx, sr_idx, cl_idx); - RB_SET_P(tree, cl_idx, s_idx); - - /* ...relabel new root as S (for common processing in case #6) */ - s_idx = sr_idx; - goto case6_x; - -case6_l: - - /*************************************************************************** - * Case #6: S is black, N is the left child of P, Sr is red - **************************************************************************/ - - if (RB_IS_BLACK(tree, p_idx)) - RB_SET_P_L(tree, s_idx, g_idx, p_idx); - else - RB_SET_P_L_C(tree, s_idx, g_idx, p_idx, RB_RED); - - RB_SET_P_R_C(tree, p_idx, s_idx, sl_idx, RB_BLK); - RB_SET_P(tree, sl_idx, p_idx); - RB_SET_C(tree, sr_idx, RB_BLK); - - /* ...S is a new root of subtree; update G */ - goto case6_x; - -case6_r: - - /*************************************************************************** - * Case #6: S is black, N is the right child of P, Sl is red - **************************************************************************/ - - if (RB_IS_BLACK(tree, p_idx)) - RB_SET_P_R(tree, s_idx, g_idx, p_idx); - else - RB_SET_P_R_C(tree, s_idx, g_idx, p_idx, RB_RED); - - RB_SET_P_L_C(tree, p_idx, s_idx, sr_idx, RB_BLK); - RB_SET_P(tree, sr_idx, p_idx); - RB_SET_C(tree, sl_idx, RB_BLK); - - /* ...S is a new root of subtree; update G */ - goto case6_x; - -case6_x: - - /* ...S is a new root of subtree; update G's pointer */ - if (g_idx == RB_NULL(tree)) - RB_SET_ROOT(tree, s_idx); - else if (p_idx == RB_LEFT(tree, g_idx)) - RB_SET_L(tree, g_idx, s_idx); - else - RB_SET_R(tree, g_idx, s_idx); - - /* ...tree is balanced; pass through */ - -done: - - return; -} - -/* ...high-level API function */ -rb_idx_t rb_delete(rb_tree_t *tree, rb_idx_t n_idx) -{ - rb_idx_t p_idx, t_idx, m_idx, c_idx, l_idx, r_idx, k_idx; - u32 color; - - /* ...save parent of element N that we are going to remove */ - p_idx = RB_PARENT(tree, n_idx); - - /* ...get in-order predecessor/successor of n_idx, if possible */ - if ((m_idx = RB_LEFT(tree, n_idx)) != RB_NULL(tree)) - { - while ((t_idx = RB_RIGHT(tree, m_idx)) != RB_NULL(tree)) - m_idx = t_idx; - - /* ...set the child of in-order predecessor (may be null) */ - c_idx = RB_LEFT(tree, m_idx); - } - else if ((m_idx = RB_RIGHT(tree, n_idx)) != RB_NULL(tree)) - { - while ((t_idx = RB_LEFT(tree, m_idx)) != RB_NULL(tree)) - m_idx = t_idx; - - /* ...set the child of in-order successor (may be null) */ - c_idx = RB_RIGHT(tree, m_idx); - } - else if (p_idx == RB_NULL(tree)) - { - /* ...tree consists of the only root node N that we are removing */ - RB_SET_ROOT(tree, m_idx); - - /* ..return tree null pointer */ - return m_idx; - } - else - { - /* ...N is a (non-root) leaf node; M and C are null */ - c_idx = m_idx; - - /* ...save the color of the node we are going to delete */ - color = RB_COLOR(tree, n_idx); - - /* ...set new parent of C */ - t_idx = p_idx; - - /* ...pointer that we return as in-order predecessor/successor */ - k_idx = p_idx; - - /* ...adjust only parent of the N */ - goto adjust_parent; - } - - /* ...node that replaces our component is M */ - k_idx = m_idx; - - /*************************************************************************** - * Replace node N with M - **************************************************************************/ - - /* ...save original color of M (the node that we are deleting) */ - color = RB_COLOR(tree, m_idx); - - /* ...put M in place of N; get N's children */ - l_idx = RB_LEFT(tree, n_idx); - r_idx = RB_RIGHT(tree, n_idx); - - /* ...see if M is a child of N */ - if ((t_idx = RB_PARENT(tree, m_idx)) != n_idx) - { - /* ...C becomes left or right child of M's original parent T */ - if (c_idx == RB_LEFT(tree, m_idx)) - RB_SET_R(tree, t_idx, c_idx); - else - RB_SET_L(tree, t_idx, c_idx); - - /* ...adjust C parent pointer (okay if it's null) */ - RB_SET_P(tree, c_idx, t_idx); - - /* ...set all pointers of node M (it replaces N) */ - RB_SET_P_L_R(tree, m_idx, p_idx, l_idx, r_idx); - RB_SET_P(tree, l_idx, m_idx); - RB_SET_P(tree, r_idx, m_idx); - } - else - { - /* ...M is a left or right child of N; it gets to N's place, and C remains intact */ - if (m_idx == l_idx) - { - RB_SET_P_R(tree, m_idx, p_idx, r_idx); - RB_SET_P(tree, r_idx, m_idx); - } - else - { - RB_SET_P_L(tree, m_idx, p_idx, l_idx); - RB_SET_P(tree, l_idx, m_idx); - } - - /* ...parent of C is still M (we label it as T) */ - t_idx = m_idx; - } - - /* ...paint M in the same color as N which it replaced */ - if (RB_IS_BLACK(tree, n_idx)) - RB_SET_C(tree, m_idx, RB_BLK); - else - RB_SET_C(tree, m_idx, RB_RED); - -adjust_parent: - - /* ...adjust N's parent node to point to M */ - if (p_idx == RB_NULL(tree)) - RB_SET_ROOT(tree, m_idx); - else if (n_idx == RB_LEFT(tree, p_idx)) - RB_SET_L(tree, p_idx, m_idx); - else - RB_SET_R(tree, p_idx, m_idx); - - /* ...check for a color of deleted item (M or N in case it is a leaf) */ - if (color == RB_BLK) - { - if (c_idx == RB_NULL(tree)) - /* ...rebalance the tree for a T node (it is never a null)*/ - __rb_delete_rebalance(tree, t_idx); - else - /* ...C node exists and is necessarily red; repaint it black */ - RB_SET_C(tree, c_idx, RB_BLK); - } - - /* ....return the node K which replaced deleted node N */ - return k_idx; -} - -/******************************************************************************* - * rb_replace - * - * Replace the node with the same-key node - adjust tree pointers - ******************************************************************************/ - -void rb_replace(rb_tree_t *tree, rb_idx_t n_idx, rb_idx_t t_idx) -{ - rb_idx_t p_idx, l_idx, r_idx; - - /* ...get node pointers */ - p_idx = RB_PARENT(tree, n_idx), l_idx = RB_LEFT(tree, n_idx), r_idx = RB_RIGHT(tree, n_idx); - - /* ...set new node pointers */ - RB_SET_P_L_R(tree, t_idx, p_idx, l_idx, r_idx); - - /* ...set node color */ - if (RB_IS_BLACK(tree, n_idx)) - RB_SET_C(tree, t_idx, RB_BLK); - else - RB_SET_C(tree, t_idx, RB_RED); - - /* ...update parent node */ - if (p_idx == RB_NULL(tree)) - RB_SET_ROOT(tree, t_idx); - else if (n_idx == RB_LEFT(tree, p_idx)) - RB_SET_L(tree, p_idx, t_idx); - else - RB_SET_R(tree, p_idx, t_idx); - - /* ...update children's parent node (okay if null) */ - RB_SET_P(tree, l_idx, t_idx), RB_SET_P(tree, r_idx, t_idx); -} diff --git a/hifi/xaf/hifi-dpf/core/util/tinyvprintf.c b/hifi/xaf/hifi-dpf/core/util/tinyvprintf.c deleted file mode 100644 index 25d7e03e..00000000 --- a/hifi/xaf/hifi-dpf/core/util/tinyvprintf.c +++ /dev/null @@ -1,198 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - - -#include <string.h> -#include "lib/tinyput.h" - - -/* - * Simple formatted output routine. - * Designed primarily for small size (and secondarily for efficiency). - * Only a common subset of printf formats and options are handled: - * - * %[-+ ][0][width]i decimal signed integer - * %[-+ ][0][width]d decimal signed integer - * %[-][0][width]u decimal unsigned integer - * %[-][0][width]x hex unsigned integer - * %[-][0][width]p hex unsigned integer with 0x prefix ("pointer") - * %[-][width]c single character - * %[-][width]s string - * - * These modifiers are ignored (legally on 32-bit Xtensa): - * # (alternate format) - * h (short) expands to int on 32-bit Xtensa - * l (long) same as int on 32-bit Xtensa - * j (intmax_t or uintmax_t) same as int on 32-bit Xtensa - * z (size_t or ssize_t) same as int on 32-bit Xtensa - * t (ptrdiff_t) same as int on 32-bit Xtensa - * - * Does NOT support: - * width.prec (precision modifier) - * %X (capitalized hex; handles this as lowercase hex) - * %o (octal) - * %[L][feEgG] (floating point formats) - * %a %A (hex floating point formats, C99) - * %C (multibyte character) - * %S (multibyte character string) - * %n (returning count of character written) - * ll (long long) - * q j z t (other size modifiers, eg. see glibc) - */ -int tiny_vsprintf(char *out, const char *fmt, va_list ap) -{ - int total = 0; - char c, space = ' ', buf[11]; /* largest 32-bit integer output (octal) */ - - while ((c = *(char*)fmt++) != 0) { - if (c != '%') { - *out++ = c; - total++; - } else { - int width = 0, len = 1, rightjust = 1; - unsigned n; - char *s = buf, *t, pad = ' ', sign = 0; - while (1) { - c = *(char*)fmt++; - switch (c) { - case 'c': buf[0] = va_arg(ap, int); goto donefmt; - case 's': s = va_arg(ap, char*); - if (s == 0) - len = 0; - else { - for (t = s; *t; t++) ; - len = t - s; - } - goto donefmt; - - case '#': /* ignore (not supported) */ - case 'h': /* ignore (short; passed as int) */ - case 'l': /* ignore (long; same as int) */ - case 'j': /* ignore (intmax_t or uintmax_t; same as int) */ - case 'z': /* ignore (size_t or ssize_t; same as int) */ - case 't': /* ignore (ptrdiff_t; same as int) */ - break; - - case ' ': sign = ' '; break; - case '+': sign = '+'; break; - case '-': rightjust = 0; break; - - case 'i': /*FALLTHROUGH*/ - case 'd': n = va_arg(ap, int); - if ((int)n < 0) { - sign = '-'; - n = -(int)n; - } - if (sign) { - if (rightjust && pad == ' ') - *s++ = sign; - else { - *out++ = sign; - width--; - total++; - } - } - goto do_decimal; - case 'u': n = va_arg(ap, int); - do_decimal: - { - /* (avoids division or multiplication) */ - int digit, i, seen = 0; - for (digit = 0; n >= 1000000000; digit++) - n -= 1000000000; - for (i = 9;;) { - if (!seen && digit != 0) - seen = i; - if (seen) - *s++ = '0' + digit; - for (digit = 0; n >= 100000000; digit++) - n -= 100000000; - if (--i == 0) { - *s++ = '0' + digit; - len = s - buf; - s = buf; - goto donefmt; - } - n = ((n << 1) + (n << 3)); - } - } - /*NOTREACHED*/ - -#if 0 - case 'o': n = va_arg(ap, unsigned); - s = buf + 11; - do { - *--s = '0' + (n & 7); - n = (unsigned)n >> 3; - } while (n); - len = buf + 11 - s; - goto donefmt; -#endif - - case 'p': *out++ = '0', *out++ = 'x'; - total += 2; - /*FALLTHROUGH*/ - case 'X': /*FALLTHROUGH*/ - case 'x': n = va_arg(ap, unsigned); - s = buf + 8; - do { - *--s = "0123456789abcdef"[n & 0xF]; - n = (unsigned)n >> 4; - } while (n); - len = buf + 8 - s; - goto donefmt; - - case 0: goto done; - case '0': if (width == 0) pad = '0'; /*FALLTHROUGH*/ - default: if (c >= '0' && c <= '9') - width = ((width<<1) + (width<<3)) + (c - '0'); - else { - buf[0] = c; /* handles case of '%' */ - goto donefmt; - } - } - } - /*NOTREACHED*/ - donefmt: - if (len < width) { - total += width; - if (rightjust) - do { *out++ = pad; } while (len < --width); - } else - total += len; - for(n = len; n > 0; n--) *out++ = *s++; - for (; len < width; len++) *out++ = space; - } - } -done: - return total; -} - -int tiny_sprintf(char *out, const char *fmt, ...) -{ - int n = 0; - va_list ap; - va_start(ap, fmt); - n = tiny_vsprintf(out, fmt, ap); - va_end(ap); - return n; -} diff --git a/hifi/xaf/hifi-dpf/core/xf-core.c b/hifi/xaf/hifi-dpf/core/xf-core.c deleted file mode 100644 index 95bca129..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-core.c +++ /dev/null @@ -1,709 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-core.c - * - * DSP processing framework core - * - ******************************************************************************/ - -#define MODULE_TAG CORE - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing tags - ******************************************************************************/ - -/* ...general initialization sequence */ -TRACE_TAG(INIT, 1); - -/* ...message dispatching */ -TRACE_TAG(DISP, 1); - -/* ...client registration procedures */ -TRACE_TAG(REG, 1); - -/* ...ports routing/unrouting */ -TRACE_TAG(ROUTE, 1); - -#ifdef XAF_PROFILE_DSP -/* ... MCPS/profile info */ -#include "xa_profiler.h" -#endif -/******************************************************************************* - * Internal helpers - ******************************************************************************/ - -/* ...translate client-id into component handle */ -static inline xf_component_t * xf_client_lookup(xf_core_data_t *cd, u32 client) -{ - xf_cmap_link_t *link = &cd->cmap[client]; - - /* ...if link pointer is less than XF_CFG_MAX_CLIENTS, it is a free descriptor */ - return (link->next > XF_CFG_MAX_CLIENTS ? link->c : NULL); -} - -/* ...allocate client-id */ -static inline u32 xf_client_alloc(xf_core_data_t *cd) -{ - u32 client = cd->free; - - /* ...advance list head to next free id */ - (client < XF_CFG_MAX_CLIENTS ? cd->free = cd->cmap[client].next : 0); - - return client; -} - -/* ...recycle client-id */ -static inline void xf_client_free(xf_core_data_t *cd, u32 client) -{ - /* ...put client into the head of the free id list */ - cd->cmap[client].next = cd->free, cd->free = client; -} - -/******************************************************************************* - * Process commands to a proxy - ******************************************************************************/ - -/* ...register new client */ -static int xf_proxy_register(u32 core, xf_message_t *m) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - u32 src = XF_MSG_SRC(m->id); - u32 client; - xf_component_t *component; - - /* ...allocate new client-id */ - XF_CHK_ERR((client = xf_client_alloc(cd)) != XF_CFG_MAX_CLIENTS, -EBUSY); - - /* ...create component via class factory */ - if ((component = xf_component_factory(core, m->buffer, m->length)) == NULL) - { - TRACE(ERROR, _x("Component creation failed")); - - /* ...recycle client-id */ - xf_client_free(cd, client); - - /* ...return generic out-of-memory code always (tbd) */ - return -ENOMEM; - } - - /* ...register component in a map */ - cd->cmap[client].c = component; - - /* ...set component "default" port specification ("destination") */ - component->id = __XF_PORT_SPEC(core, client, 0); - - /* ...adjust session-id to include newly created component-id */ - m->id = __XF_MSG_ID(src, component->id); - - /* ...do system-specific registration of component within IPC layer */ - xf_ipc_component_addref(m->id); - - TRACE(REG, _b("registered client: %u:%u (%s)"), core, client, (xf_id_t)m->buffer); - - /* ...and return success to remote proxy (zero-length output) */ - xf_response_ok(m); - - return 0; -} - -/* ...shared buffer allocation request */ -static int xf_proxy_alloc(u32 core, xf_message_t *m) -{ - /* ...command is valid only if shared memory interface for core is specified */ - XF_CHK_ERR(xf_shmem_enabled(core), -EPERM); - - /* ...allocate shared memory buffer (system-specific function; may fail) */ - xf_shmem_alloc(core, m); - - /* ...pass result to remote proxy (on success buffer is non-null) */ - xf_response(m); - - return 0; -} - -/* ...shared buffer freeing request */ -static int xf_proxy_free(u32 core, xf_message_t *m) -{ - /* ...command is valid only if shared memory interface for core is specified */ - XF_CHK_ERR(xf_shmem_enabled(core), -EPERM); - - /* ...pass buffer freeing request to system-specific function */ - xf_shmem_free(core, m); - - /* ...return success to remote proxy (function never fails) */ - xf_response(m); - - return 0; -} - -#if 0 -/* ...port routing command processing */ -static int xf_proxy_route(u32 core, xf_message_t *m) -{ - xf_route_port_msg_t *cmd = m->buffer; - u32 src = cmd->src; - u32 dst = cmd->dst; - xf_component_t *component; - xf_output_port_t *port; - - /* ...source component must reside on the local core */ - XF_CHK_ERR(XF_MSG_SRC_CORE(src) == core, -EINVAL); - - /* ...make sure the "src" component is valid ("dst" may reside on other core) */ - if ((component = xf_client_lookup(XF_CORE_DATA(core), XF_PORT_CLIENT(src))) == NULL) - { - TRACE(ERROR, _x("Source port lookup failed: %x"), src); - return -ENOENT; - } - else if (!component->port || !(port = component->port(component, XF_PORT_ID(src)))) - { - TRACE(ERROR, _b("Source port doesn't exist: %x"), src); - return -ENOENT; - } - else if (xf_output_port_routed(port)) - { - TRACE(ERROR, _b("Source port is already routed: %x"), src); - return -EBUSY; - } - - /* ...route output port with source port set as destination */ - XF_CHK_API(xf_output_port_route(port, __XF_MSG_ID(dst, src), cmd->alloc_number, cmd->alloc_size, cmd->alloc_align)); - - TRACE(ROUTE, _b("Ports routed: %03x -> %03x"), src, dst); - - /* ...invoke component data-processing function directly (ignore errors? - tbd) */ - component->entry(component, NULL); - - /* ...return success result code (no output attached) */ - xf_response_ok(m); - - return 0; -} - -/* ...disconnect ports */ -static int xf_proxy_unroute(u32 core, xf_message_t *m) -{ - xf_unroute_port_msg_t *cmd = m->buffer; - u32 src = cmd->src; - xf_component_t *component; - xf_output_port_t *port; - - /* ...source component must reside on the local core */ - XF_CHK_ERR(XF_MSG_SRC_CORE(src) == core, -EINVAL); - - /* ...lookup source (output) port */ - if ((component = xf_client_lookup(XF_CORE_DATA(core), XF_PORT_CLIENT(src))) == NULL) - { - TRACE(ERROR, _b("Source port lookup failed: %x"), src); - return -ENOENT; - } - else if (!component->port || !(port = component->port(component, XF_PORT_ID(src)))) - { - TRACE(ERROR, _b("Source port doesn't exist: %x"), src); - return -ENOENT; - } - else if (!xf_output_port_routed(port)) - { - /* ...port is not routed; satisfy immediately */ - goto done; - } - else if (!xf_output_port_idle(port)) - { - TRACE(ERROR, _b("Source port is not idle: %x"), src); - return -EBUSY; - } - - /* ...unroute port (call must succeed) */ - xf_output_port_unroute(port); - - /* ...we cannot satisfy the command now, and need to propagate it to a sink - tbd */ - //return 0; - -done: - /* ...pass success result code to caller */ - xf_response_ok(m); - - return 0; -} -#endif - -/* ...fill-this-buffer command processing */ -static int xf_proxy_output(u32 core, xf_message_t *m) -{ - /* ...determine destination "client" */ - switch (XF_MSG_SRC_CLIENT(m->id)) - { -#if XF_TRACE_REMOTE - case 0: - /* ...destination is a tracer facility; submit buffer to tracer */ - xf_trace_submit(core, m); - return 0; -#endif - - default: - /* ...unrecognized destination; return general failure response */ - return XF_CHK_ERR(0, -EINVAL); - } -} - -/* ...flush command processing */ -static int xf_proxy_flush(u32 core, xf_message_t *m) -{ - /* ...determine destination "client" */ - switch (XF_MSG_SRC_CLIENT(m->id)) - { -#if XF_TRACE_REMOTE - case 0: - /* ...destination is a tracer facility; flush current buffer */ - xf_trace_flush(core, m); - return 0; -#endif - - default: - /* ...unrecognized destination; return general failure response */ - return XF_CHK_ERR(0, -EINVAL); - } -} - -/* ...proxy command processing table */ -static int (* const xf_proxy_cmd[])(u32, xf_message_t *) = -{ - [XF_OPCODE_TYPE(XF_REGISTER)] = xf_proxy_register, - [XF_OPCODE_TYPE(XF_ALLOC)] = xf_proxy_alloc, - [XF_OPCODE_TYPE(XF_FREE)] = xf_proxy_free, -#if 0 - [XF_OPCODE_TYPE(XF_ROUTE)] = xf_proxy_route, - [XF_OPCODE_TYPE(XF_UNROUTE)] = xf_proxy_unroute, -#endif - [XF_OPCODE_TYPE(XF_FILL_THIS_BUFFER)] = xf_proxy_output, - [XF_OPCODE_TYPE(XF_FLUSH)] = xf_proxy_flush, -}; - -/* ...total number of commands supported */ -#define XF_PROXY_CMD_NUM (sizeof(xf_proxy_cmd) / sizeof(xf_proxy_cmd[0])) - -/* ...process commands to a proxy */ -static void xf_proxy_command(u32 core, xf_message_t *m) -{ - u32 opcode = m->opcode; - int res; - - /* ...dispatch command to proper hook */ - if (XF_OPCODE_TYPE(opcode) < XF_PROXY_CMD_NUM) - { - if ((res = xf_proxy_cmd[XF_OPCODE_TYPE(opcode)](core, m)) >= 0) - { - /* ...command processed successfully; do nothing */ - return; - } - } - else - { - TRACE(ERROR, _x("invalid opcode: %x"), opcode); - } - - /* ...command processing failed; return generic failure response */ - xf_response_err(m); -} - -/******************************************************************************* - * Message completion helper - ******************************************************************************/ - -/* ...put message into local IPC command queue on remote core (src != dst) */ -static inline void xf_msg_local_ipc_put(u32 src, u32 dst, xf_message_t *m) -{ - xf_core_rw_data_t *rw = XF_CORE_RW_DATA(dst); - int first; - - /* ...flush message payload if needed */ - if (XF_LOCAL_IPC_NON_COHERENT) - { - /* ...it may be a command with output payload only - tbd */ - XF_PROXY_FLUSH(m->buffer, m->length); - } - - /* ...acquire mutex to target rw-data (running on source core) */ - xf_mutex_lock(src); - - /* ...assure memory coherency as needed */ - if (XF_LOCAL_IPC_NON_COHERENT) - { - /* ...invalidate local queue data */ - XF_PROXY_INVALIDATE(&rw->local, sizeof(rw->local)); - - /* ...place message into queue */ - first = xf_msg_enqueue(&rw->local, m); - - /* ...flush both queue and message data */ - XF_PROXY_FLUSH(&rw->local, sizeof(rw->local)), XF_PROXY_FLUSH(m, sizeof(*m)); - } - else - { - /* ...just enqueue the message */ - first = xf_msg_enqueue(&rw->local, m); - } - - /* ...release global rw-memory access lock */ - xf_mutex_unlock(src); - - /* ...signal IPI interrupt on destination core as needed */ - (first ? xf_ipi_assert(dst), 1 : 0); -} - -/* ...dequeue message from core-specific dispatch queue */ -static inline xf_message_t * xf_msg_local_ipc_get(u32 core) -{ - xf_core_rw_data_t *rw = XF_CORE_RW_DATA(core); - xf_message_t *m; - - /* ...retrieve message from queue in atomic fashion */ - xf_mutex_lock(core); - - /* ...process memory coherency as required */ - if (XF_LOCAL_IPC_NON_COHERENT) - { - /* ...inavlidate local rw-data */ - XF_PROXY_INVALIDATE(&rw->local, sizeof(rw->local)); - - /* ...get message from the queue */ - if ((m = xf_msg_dequeue(&rw->local)) != NULL) - { - /* ...flush rw-queue data */ - XF_PROXY_FLUSH(&rw->local, sizeof(rw->local)); - } - } - else - { - /* ...just dequeue message from the queue */ - m = xf_msg_dequeue(&rw->local); - } - - /* ...release rw-memory access lock */ - xf_mutex_unlock(core); - - /* ...invalidate message header and data as needed */ - if (XF_LOCAL_IPC_NON_COHERENT && m != NULL) - { - /* ...invalidate message header */ - XF_PROXY_INVALIDATE(m, sizeof(*m)); - - /* ...and data if needed (it may not be always needed - tbd) */ - (m->length ? XF_PROXY_INVALIDATE(m->buffer, m->length) : 0); - } - - /* ...return message */ - return m; -} - -/* ...retrieve message from local queue (protected from ISR) */ -static inline int xf_msg_local_put(u32 core, xf_message_t *m) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - int first; - u32 status; - - /* ...use interrupt masking protocol to protect message queue */ - status = xf_isr_disable(core); - first = xf_msg_enqueue(&cd->queue, m); - xf_isr_restore(core, status); - - return first; -} - -/* ...retrieve message from local queue (protected from ISR) */ -static inline xf_message_t * xf_msg_local_get(u32 core) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - xf_message_t *m; - u32 status; - - /* ...use interrupt masking protocol to protect message queue */ - status = xf_isr_disable(core); - m = xf_msg_dequeue(&cd->queue); - xf_isr_restore(core, status); - - return m; -} - -/* ...retrieve message from local queue (protected from ISR) */ -static inline xf_message_t * xf_msg_local_response_get(u32 core) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - xf_message_t *m; - u32 status; - - /* ...use interrupt masking protocol to protect message queue */ - status = xf_isr_disable(core); - m = xf_msg_dequeue(&cd->response); - xf_isr_restore(core, status); - - return m; -} - -/* ...call component data processing function */ -static inline void xf_core_process(xf_component_t *component) -{ - u32 id = component->id; - - /* ...client look-up successfull */ - TRACE(DISP, _b("core[%u]::client[%u]::process"), XF_PORT_CORE(id), XF_PORT_CLIENT(id)); - - /* ...call data-processing interface */ - if (component->entry(component, NULL) < 0) - { - TRACE(ERROR, _b("execution error (ignored)")); - } -} - -/* ...dispatch message queue execution */ -static inline void xf_core_dispatch(xf_core_data_t *cd, u32 core, xf_message_t *m) -{ - u32 client; - xf_component_t *component; - - /* ...do client-id/component lookup */ - if (XF_MSG_DST_PROXY(m->id)) - { - TRACE(DISP, _b("core[%u]::proxy-cmd(id=%x, opcode=%x)"), core, m->id, m->opcode); - - /* ...process message addressed to proxy */ - xf_proxy_command(core, m); - - /* ...do not like this return statement... - tbd */ - return; - } - - /* ...message goes to local component */ - client = XF_MSG_DST_CLIENT(m->id); - - /* ...check if client is alive */ - if ((component = xf_client_lookup(cd, client)) != NULL) - { - /* ...client look-up successfull */ - TRACE(DISP, _b("core[%u]::client[%u]::cmd(id=%x, opcode=%x)"), core, client, m->id, m->opcode); - - /* ...pass message to component entry point */ - if (component->entry(component, m) < 0) - { - /* ...call component destructor */ - if (component->exit(component, m) == 0) - { - /* ...component cleanup completed; recycle component-id */ - xf_client_free(cd, client); - - /* ...do system-specific deregistration of component within IPC layer */ - xf_ipc_component_rmref(__XF_PORT_SPEC(core, client, 0)); - } - } - } - else - { - TRACE(DISP, _b("Discard message id=%x - client %u:%u not registered"), m->id, core, client); - - /* ...complete message with general failure response */ - xf_response_err(m); - } -} - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...submit message for instant execution on some core */ -void xf_msg_submit(xf_message_t *m) -{ - u32 src = XF_MSG_SRC_CORE(m->id); - u32 dst = XF_MSG_DST_CORE(m->id); - - /* ...check if message shall go through local IPC layer */ - if (src ^ dst) - { - /* ...put message into local IPC queue */ - xf_msg_local_ipc_put(src, dst, m); - } - else - { - /* ...message is addressed to same core */ - xf_msg_local_put(src, m); - } -} - -/* ...complete message and pass response to a caller */ -void xf_msg_complete(xf_message_t *m) -{ - u32 src = XF_MSG_SRC(m->id); - u32 dst = XF_MSG_DST(m->id); - - /* ...swap src/dst specifiers */ - m->id = __XF_MSG_ID(dst, src); - - /* ...check if message goes to remote IPC layer */ - if (XF_MSG_DST_PROXY(m->id)) - { - /* ...return message to proxy */ - xf_msg_proxy_complete(m); - } - else - { - /* ...destination is within DSP cluster; check if that is a data buffer */ - switch (m->opcode) - { - case XF_EMPTY_THIS_BUFFER: - /* ...emptied buffer goes back to the output port */ - m->opcode = XF_FILL_THIS_BUFFER; - break; - - case XF_FILL_THIS_BUFFER: - /* ...filled buffer is passed to the input port */ - m->opcode = XF_EMPTY_THIS_BUFFER; - break; - } - - /* ...submit message for execution */ - xf_msg_submit(m); - } -} - -/* ...initialize per-core framework data */ -int xf_core_init(u32 core) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - xf_cmap_link_t *link; - u32 i; - - /* ...create list of free client descriptors */ - for (link = &cd->cmap[i = 0]; i < XF_CFG_MAX_CLIENTS; i++, link++) - { - link->next = i + 1; - } - - /* ...set head of free clients list */ - cd->free = 0; - - /* ...initialize local queue scheduler */ - xf_sched_init(&cd->sched); - - /* ...initialize IPI subsystem */ - XF_CHK_API(xf_ipi_init(core)); - - /* ...initialize shared read-write memory */ - XF_CHK_API(xf_shmem_enabled(core) ? xf_shmem_init(core) : 0); - - /* ...initialize scratch memory */ - XF_CHK_ERR(cd->scratch = xf_scratch_mem_init(core), -ENOMEM); - - /* ...okay... it's all good */ - TRACE(INIT, _b("core-%u initialized"), core); - - return 0; -} - -/* ...core executive loop function */ -void xf_core_service(u32 core) -{ - xf_core_data_t *cd = &xf_core_data[core]; - u32 status; - xf_message_t *m; - xf_task_t *t; - -#ifdef XAF_PROFILE_DSP - START_TIME_XA_PROFILER(prof); -#endif - do - { - /* ...clear local status change */ - status = 0; - - /* ...if core is servicing shared memory with AP, do it first - actually, they all need to support it */ - if (xf_shmem_enabled(core)) - { - /* ...process all commands */ - xf_shmem_process_queues(core); - } - - /* ...check if we have a backlog message placed into interim queue */ - while ((m = xf_msg_local_ipc_get(core)) || (m = xf_msg_local_get(core))) - { - /* ...dispatch message execution */ - xf_core_dispatch(cd, core, m); - - /* ...set local status change */ - status = 1; - } - - /* ...check if we have pending responses (submitted from ISR) we need to process */ - while ((m = xf_msg_local_response_get(core)) != NULL) - { - /* ...call completion handler on current stack */ - xf_msg_complete(m); - - /* ...set local status change */ - status = 1; - - } - - /* ...if scheduler queue is empty, break the loop and pause the core */ - if ((t = xf_sched_get(&cd->sched)) != NULL) - { - /* ...data-processing execution (ignore internal errors) */ - xf_core_process((xf_component_t *)t); - - /* ...set local status change */ - status = 1; - } - } - while (status); - -#ifdef XAF_PROFILE_DSP - STOP_TIME_XA_PROFILER(prof); - - if(prof.g_output_bytes) - { - unsigned long output_samples = prof.g_output_bytes; - output_samples >>= (prof.channels == 2 ? 1 : 0); - output_samples >>= (prof.pcm_width == 24 ? 2 : 1); - - COMPUTE_MHZ_XA_PROFILER(prof, output_samples, prof.sample_rate, 0); - - prof.g_output_bytes = prof.cycles = 0; /* reset counters */ - } -#endif - -} - -/* ...global data initialization function */ -int xf_global_init(void) -{ - /* ...what global data we have to initialize? - tbd */ - TRACE(INIT, _b("Global data initialized")); - - return 0; -} diff --git a/hifi/xaf/hifi-dpf/core/xf-io.c b/hifi/xaf/hifi-dpf/core/xf-io.c deleted file mode 100644 index 4ec415c2..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-io.c +++ /dev/null @@ -1,644 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-io.c - * - * Generic input/output ports handling - * - ******************************************************************************/ - -#define MODULE_TAG IO - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(INPUT, 1); -TRACE_TAG(OUTPUT, 1); -TRACE_TAG(ROUTE, 1); - -/******************************************************************************* - * Input port API - ******************************************************************************/ - -/* ...initialize input port structure */ -int xf_input_port_init(xf_input_port_t *port, u32 size, u32 align, u32 core) -{ - /* ...allocate local internal buffer of particular size and alignment */ - if (size) - { - /* ...internal buffer is used */ - XF_CHK_ERR(port->buffer = xf_mem_alloc(size, align, core, 0), -ENOMEM); - } - else - { - /* ...no internal buffering is used */ - port->buffer = NULL; - } - - /* ...initialize message queue */ - xf_msg_queue_init(&port->queue); - - /* ...set buffer size */ - port->length = size; - - /* ...enable input by default */ - port->flags = XF_INPUT_FLAG_ENABLED | XF_INPUT_FLAG_CREATED; - - /* ...mark buffer is empty */ - port->filled = 0, port->access = NULL; - - TRACE(INIT, _b("input-port[%p] created - %p@%u[%u]"), port, port->buffer, align, size); - - return 0; -} - -/* ...put message into input port queue; return non-zero if queue was empty */ -int xf_input_port_put(xf_input_port_t *port, xf_message_t *m) -{ - /* ...check if input is enabled */ - if ((port->flags & XF_INPUT_FLAG_ENABLED) == 0) - { - /* ...input disabled; this is an error condition, likely */ - TRACE(INPUT, _b("input-port[%p] disabled"), port); - - /* ...release the message instantly */ - xf_response_ok(m); - - /* ...buffer has not been accepted - no actions to take */ - return 0; - } - else if (m->length == 0) - { - /* ...it is forbidden to pass more than one zero-length message */ - BUG(port->flags & XF_INPUT_FLAG_EOS, _x("invalid state: %x"), port->flags); - - /* ...received a message with zero-length; mark end-of-stream condition */ - port->flags ^= XF_INPUT_FLAG_ENABLED | XF_INPUT_FLAG_EOS; - - /* ...still enqueue that zero-length message; it will be processed afterwards */ - TRACE(INPUT, _b("input-port[%p]: zero-length buffer received"), port); - } - else - { - TRACE(INPUT, _b("input-port[%p]: buffer received - %u bytes"), port, m->length); - } - - /* ...enqueue message and set access pointer as needed */ - if (xf_msg_enqueue(&port->queue, m)) - { - /* ...first message put - set access pointer and length */ - port->access = m->buffer, port->remaining = m->length; - - /* ...if first message is empty, mark port is done */ - (!port->access ? port->flags ^= XF_INPUT_FLAG_EOS | XF_INPUT_FLAG_DONE : 0); - - /* ...return non-zero to indicate the first buffer is placed into port */ - return 1; - } - else - { - /* ...subsequent message placed into buffer */ - return 0; - } -} - -/* ...internal helper - input message completion */ -static inline int xf_input_port_complete(xf_input_port_t *port) -{ - /* ...dequeue message from queue */ - xf_message_t *m = xf_msg_dequeue(&port->queue); - - /* ...message cannot be NULL */ - BUG(m == NULL, _x("invalid port state")); - - /* ...complete current message (EMPTY-THIS-BUFFER always; no length adjustment) */ - xf_response(m); - - /* ...set up next head */ - if ((m = xf_msg_queue_head(&port->queue)) != NULL) - { - /* ...set new access pointers */ - port->access = m->buffer, port->remaining = m->length; - - /* ...return indication that there is an input message */ - return 1; - } - else - { - /* ...no more messages; reset access pointer */ - port->access = NULL; - - /* ...return indication that input port has no data available */ - return 0; - } -} - -/* ...fill-in required amount of data into input port buffer */ -int xf_input_port_fill(xf_input_port_t *port) -{ - u32 filled = port->filled; - u32 remaining = port->remaining; - u32 copied = 0; - s32 n; - - /* ...function shall not be called if no internal buffering is used */ - BUG(xf_input_port_bypass(port), _x("Invalid transaction")); - - /* ...if there is no message pending, bail out */ - if (!xf_msg_queue_head(&port->queue)) - { - TRACE(INPUT, _b("No message ready")); - return 0; - } - - /* ...calculate total amount of bytes we need to copy */ - n = (s32)(port->length - filled); - - /* ...get at most "n" bytes from input message(s) buffer(s) */ - while (n > 0) - { - u32 k; - - /* ...determine the size of the chunk to copy */ - ((k = remaining) > n ? k = n : 0); - - /* ...process zero-length input message separately */ - if (k == 0) - { - /* ...end-of-stream condition must be set */ - BUG((port->flags & XF_INPUT_FLAG_EOS) == 0, _x("port[%p]: invalid state: %x"), port, port->flags); - - /* ...mark stream is completed */ - port->flags ^= XF_INPUT_FLAG_EOS | XF_INPUT_FLAG_DONE; - - /* ...reset total amount of bytes to fill */ - n = 0; - - /* ...do not release message yet */ - TRACE(INPUT, _b("input-port[%p] done"), port); - - /* ...and break the loop */ - break; - } - - /* ...buffer must be set */ - BUG(!port->access, _x("invalid port state")); - - /* ...get required amount from input buffer */ - memcpy(port->buffer + filled, port->access, k), port->access += k; - - /* ...advance buffer positions */ - filled += k, copied += k, n -= k; - - /* ...check if input buffer is processed completely */ - if ((remaining -= k) == 0) - { - if (!xf_input_port_complete(port)) - { - /* ...no more input messages; break the loop */ - break; - } - else - { - /* ...update remaining counter */ - remaining = port->remaining; - } - } - } - - /* ...update buffer positions */ - port->filled = filled, port->remaining = remaining; - - /* ...return indicator whether input buffer is prefilled */ - return (n == 0); -} - -/* ...pad input buffer with given pattern */ -void xf_input_port_pad(xf_input_port_t *port, u8 pad) -{ - u32 filled = port->filled; - s32 k; - - /* ...do padding if port buffer is not filled */ - if ((k = port->length - filled) > 0) - { - memset(port->buffer + filled, pad, k); - - /* ...indicate port is filled */ - port->filled = port->length; - } -} - -/* ...consume input buffer data */ -void xf_input_port_consume(xf_input_port_t *port, u32 n) -{ - /* ...check whether input port is in bypass mode */ - if (xf_input_port_bypass(port)) - { - /* ...port is in bypass mode; advance access pointer */ - if ((port->remaining -= n) == 0) - { - /* ...complete message and try to rearm input port */ - xf_input_port_complete(port); - - /* ...check if end-of-stream flag is set */ - if (xf_msg_queue_head(&port->queue) && !port->access) - { - BUG((port->flags & XF_INPUT_FLAG_EOS) == 0, _x("port[%p]: invalid state: %x"), port, port->flags); - - /* ...mark stream is completed */ - port->flags ^= XF_INPUT_FLAG_EOS | XF_INPUT_FLAG_DONE; - - TRACE(INPUT, _b("input-port[%p] done"), port); - } - } - else - { - /* ...advance message buffer pointer */ - port->access += n; - } - } - else if (port->filled > n) - { - u32 k = port->filled - n; - - /* ...move tail of buffer to the head (safe to use memcpy) */ - memcpy(port->buffer, port->buffer + n, k); - - /* ...adjust filled position */ - port->filled = k; - } - else - { - /* ...entire buffer is consumed; reset fill level */ - port->filled = 0; - } -} - -/* ...purge input port queue */ -void xf_input_port_purge(xf_input_port_t *port) -{ - xf_message_t *m; - - /* ...bail out early if port is not created */ - if (!xf_input_port_created(port)) return; - - /* ...free all queued messages with generic "ok" response */ - while ((m = xf_msg_dequeue(&port->queue)) != NULL) - { - xf_response_ok(m); - } - - /* ...reset internal buffer position */ - port->filled = 0, port->access = NULL; - - /* ...reset port flags */ - port->flags = (port->flags & ~__XF_INPUT_FLAGS(~0)) | XF_INPUT_FLAG_ENABLED | XF_INPUT_FLAG_CREATED; - - TRACE(INPUT, _b("input-port[%p] purged"), port); -} - -/* ...save flow-control message for propagated input port purging sequence */ -void xf_input_port_control_save(xf_input_port_t *port, xf_message_t *m) -{ - /* ...make sure purging sequence is not active */ - BUG(port->flags & XF_INPUT_FLAG_PURGING, _x("invalid state: %x"), port->flags); - - /* ...place message into internal queue */ - xf_msg_enqueue(&port->queue, m); - - /* ...set port purging flag */ - port->flags ^= XF_INPUT_FLAG_PURGING; - - TRACE(INPUT, _b("port[%p] start purge sequence"), port); -} - -/* ...mark flushing sequence is completed */ -void xf_input_port_purge_done(xf_input_port_t *port) -{ - /* ...make sure flushing sequence is ongoing */ - BUG((port->flags & XF_INPUT_FLAG_PURGING) == 0, _x("invalid state: %x"), port->flags); - - /* ...complete saved flow-control message */ - xf_response_ok(xf_msg_dequeue(&port->queue)); - - /* ...clear port purging flag */ - port->flags ^= XF_INPUT_FLAG_PURGING; - - TRACE(INPUT, _b("port[%p] purge sequence completed"), port); -} - -/* ...destroy input port data */ -void xf_input_port_destroy(xf_input_port_t *port, u32 core) -{ - /* ...bail out earlier if port is not created */ - if (!xf_input_port_created(port)) return; - - /* ...deallocate input buffer if needed */ - (port->buffer ? xf_mem_free(port->buffer, port->length, core, 0), port->buffer = NULL : 0); - - /* ...reset input port flags */ - port->flags = 0; - - TRACE(INIT, _b("input-port[%p] destroyed"), port); -} - -/******************************************************************************* - * Output port API - ******************************************************************************/ - -/* ...initialize output port (structure must be zero-initialized) */ -int xf_output_port_init(xf_output_port_t *port, u32 size) -{ - /* ...initialize message queue */ - xf_msg_queue_init(&port->queue); - - /* ...set output buffer length */ - port->length = size; - - /* ...mark port is created */ - port->flags = XF_OUTPUT_FLAG_CREATED; - - TRACE(INIT, _b("output-port[%p] initialized"), port); - - return 0; -} - -/* ...route output port */ -int xf_output_port_route(xf_output_port_t *port, u32 id, u32 n, u32 length, u32 align) -{ - u32 core = XF_MSG_DST_CORE(id); - u32 shared = XF_MSG_SHARED(id); - xf_message_t *m; - u32 i; - - /* ...allocate message pool for a port; extra message for control */ - XF_CHK_API(xf_msg_pool_init(&port->pool, n + 1, core)); - - /* ...allocate required amount of buffers */ - for (i = 1; i <= n; i++) - { - /* ...get message from pool (directly; bypass that "get" interface) */ - m = xf_msg_pool_item(&port->pool, i); - - /* ...wipe out message link pointer (debugging) */ - m->next = NULL; - - /* ...set message parameters */ - m->id = id; - m->opcode = XF_FILL_THIS_BUFFER; - m->length = length; - m->buffer = xf_mem_alloc(length, align, core, shared); - - /* ...if allocation failed, do a cleanup */ - if (!m->buffer) goto error; - - /* ...place message into output port */ - xf_msg_enqueue(&port->queue, m); - } - - /* ...setup flow-control message */ - m = xf_output_port_control_msg(port); - m->id = id; - m->length = 0; - m->buffer = NULL; - - /* ...wipe out message link pointer (debugging) */ - m->next = NULL; - - /* ...save port length */ - port->length = length; - - /* ...mark port is routed */ - port->flags |= XF_OUTPUT_FLAG_ROUTED | XF_OUTPUT_FLAG_IDLE; - - TRACE(ROUTE, _b("output-port[%p] routed: %x -> %x"), port, XF_MSG_DST(id), XF_MSG_SRC(id)); - - return 0; - -error: - /* ...allocation failed; do a cleanup */ - while (--i) - { - m = xf_msg_pool_item(&port->pool, i); - - /* ...free item */ - xf_mem_free(m->buffer, length, core, shared); - } - - /* ...destroy pool data */ - xf_msg_pool_destroy(&port->pool, core); - - return -ENOMEM; -} - -/* ...start output port unrouting sequence */ -void xf_output_port_unroute_start(xf_output_port_t *port, xf_message_t *m) -{ - /* ...port must be routed */ - BUG(!xf_output_port_routed(port), _x("invalid state: %x"), port->flags); - - /* ...save message in the queue */ - port->unroute = m; - - /* ...put port unrouting flag */ - port->flags |= XF_OUTPUT_FLAG_UNROUTING; -} - -/* ...complete port unrouting sequence */ -void xf_output_port_unroute_done(xf_output_port_t *port) -{ - xf_message_t *m; - - /* ...make sure we have an outstanding port unrouting sequence */ - BUG(!xf_output_port_unrouting(port), _x("invalid state: %x"), port->flags); - - /* ...retrieve enqueued control-flow message */ - m = port->unroute, port->unroute = NULL; - - /* ...destroy port buffers */ - xf_output_port_unroute(port); - - /* ...and pass response to the caller */ - xf_response_ok(m); -} - -/* ...unroute output port and destroy all memory buffers allocated */ -void xf_output_port_unroute(xf_output_port_t *port) -{ - xf_message_t *m = xf_output_port_control_msg(port); - u32 core = XF_MSG_DST_CORE(m->id); - u32 shared = XF_MSG_SHARED(m->id); - u32 n = port->pool.n - 1; - u32 i; - - /* ...free all messages (we are running on "dst" core) */ - for (i = 1; i <= n; i++) - { - /* ...directly obtain message item */ - m = xf_msg_pool_item(&port->pool, i); - - /* ...free message buffer (must exist) */ - xf_mem_free(m->buffer, port->length, core, shared); - } - - /* ...destroy pool data */ - xf_msg_pool_destroy(&port->pool, core); - - /* ...reset all flags */ - port->flags = XF_OUTPUT_FLAG_CREATED; - - /* ...reset message queue (it is empty again) */ - xf_msg_queue_init(&port->queue); - - TRACE(ROUTE, _b("output-port[%p] unrouted"), port); -} - -/* ...put next message to the port */ -int xf_output_port_put(xf_output_port_t *port, xf_message_t *m) -{ - /* ...in case of port unrouting sequence the flag returned will always be 0 */ - return xf_msg_enqueue(&port->queue, m); -} - -/* ...retrieve next message from the port */ -void * xf_output_port_data(xf_output_port_t *port) -{ - xf_message_t *m = xf_msg_queue_head(&port->queue); - - /* ...bail out if there is nothing enqueued */ - if (m == NULL) return NULL; - - /* ...it is not permitted to access port data when port is being unrouted */ - BUG(xf_output_port_unrouting(port), _x("invalid transaction")); - - /* ...make sure message length is sane */ - BUG(m->length < port->length, _x("Insufficient buffer length: %u < %u"), m->length, port->length); - - /* ...return access buffer pointer */ - return m->buffer; -} - -/* ...produce output message marking amount of bytes produced */ -int xf_output_port_produce(xf_output_port_t *port, u32 n) -{ - xf_message_t *m = xf_msg_dequeue(&port->queue); - - /* ...message cannot be NULL */ - BUG(m == NULL, _x("Invalid transaction")); - - /* ...it is not permitted to invoke this when port is being unrouted (or flushed - tbd) */ - BUG(xf_output_port_unrouting(port), _x("invalid transaction")); - - /* ...complete message with specified amount of bytes produced */ - xf_response_data(m, n); - - /* ...clear port idle flag (technically, not needed for unrouted port) */ - port->flags &= ~XF_OUTPUT_FLAG_IDLE; - - /* ...return indication of pending message availability */ - return (xf_msg_queue_head(&port->queue) != NULL); -} - -/* ...flush output port */ -int xf_output_port_flush(xf_output_port_t *port, u32 opcode) -{ - xf_message_t *m; - - /* ...if port is routed, we shall pass flush command to sink port */ - if (xf_output_port_routed(port)) - { - /* ...if port is idle, satisfy immediately */ - if (port->flags & XF_OUTPUT_FLAG_IDLE) return 1; - - /* ...start flushing sequence if not already started */ - if ((port->flags & XF_OUTPUT_FLAG_FLUSHING) == 0) - { - /* ...put flushing flag */ - port->flags ^= XF_OUTPUT_FLAG_FLUSHING; - - /* ...get control message from associated pool */ - m = xf_output_port_control_msg(port); - - /* ...set flow-control operation */ - m->opcode = opcode; - - /* ...message is a command, but source and destination are swapped */ - xf_response(m); - } - - /* ...zero-result indicates the flushing is in progress */ - return 0; - } - else - { - /* ...for non-routed port just complete all queued messages */ - while ((m = xf_msg_dequeue(&port->queue)) != NULL) - { - /* ...pass generic zero-length "okay" response - tbd */ - xf_response_ok(m); - } - - /* ...non-zero result indicates the flushing is done */ - return 1; - } -} - -/* ...mark flushing sequence is completed */ -void xf_output_port_flush_done(xf_output_port_t *port) -{ - /* ...make sure flushing sequence is ongoing */ - BUG((port->flags & XF_OUTPUT_FLAG_FLUSHING) == 0, _x("invalid state: %x"), port->flags); - - /* ...clear flushing flag and set idle flag */ - port->flags ^= XF_OUTPUT_FLAG_IDLE | XF_OUTPUT_FLAG_FLUSHING; - - TRACE(OUTPUT, _b("port[%p] flush sequence completed"), port); -} - -/* ...destroy output port */ -void xf_output_port_destroy(xf_output_port_t *port, u32 core) -{ - /* ...check if port is routed */ - if (xf_output_port_routed(port)) - { - /* ...port must be in idle state */ - BUG(!xf_output_port_idle(port), _x("destroying non-idle port[%p]"), port); - - /* ...unroute port */ - xf_output_port_unroute(port); - } - - /* ...reset port flags */ - port->flags = 0; - - TRACE(INIT, _b("output-port[%p] destroyed"), port); -} diff --git a/hifi/xaf/hifi-dpf/core/xf-isr.c b/hifi/xaf/hifi-dpf/core/xf-isr.c deleted file mode 100644 index 4e2add1e..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-isr.c +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-isr.c - * - * DSP processing framework - code running from interrupt context - * - ******************************************************************************/ - -#define MODULE_TAG ISR - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * API functions definitions - ******************************************************************************/ - -/* ...submit command message from interrupt context on local core */ -void xf_msg_schedule_isr(xf_message_t *m) -{ - u32 core = XF_MSG_DST_CORE(m->id); - xf_core_data_t *cd = XF_CORE_DATA(core); - - /* ...interrupt masking protocol is used for protecting local message queue */ - if (xf_msg_enqueue(&cd->queue, m)) - { - /* ...resume local scheduler if that is the first message */ - xf_ipi_resume(core); - } -} - -/* ...complete message from interrupt handler */ -void xf_msg_complete_isr(xf_message_t *m) -{ - u32 core = XF_MSG_DST_CORE(m->id); - xf_core_data_t *cd = XF_CORE_DATA(core); - - /* ...place message into response queue */ - if (xf_msg_enqueue(&cd->response, m)) - { - /* ...notify local scheduler if that is the first message */ - xf_ipi_resume(core); - } -} diff --git a/hifi/xaf/hifi-dpf/core/xf-mem.c b/hifi/xaf/hifi-dpf/core/xf-mem.c deleted file mode 100644 index ce5d8a6a..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-mem.c +++ /dev/null @@ -1,361 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-mem.c - * - * Dynamic memory allocator implementation (based on rb-tree index) - * - ******************************************************************************/ - -#define MODULE_TAG MM - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); - -/******************************************************************************* - * Internal helpers - ******************************************************************************/ - -/* ...initialize block */ -static inline xf_mm_block_t * xf_mm_block_init(void *addr, u32 size) -{ - xf_mm_block_t *b = (xf_mm_block_t *)addr; - - /* ...use 31 available bits of node color to keep aligned size */ - return b->l_node.color = size, b; -} - -/* ...check if the length of the block is less than given */ -static inline int xf_mm_block_length_less(xf_mm_block_t *b, u32 size) -{ - /* ...we don't really care about LSB of color */ - return (b->l_node.color < size); -} - -/* ...return exact block length */ -static inline u32 xf_mm_block_length(xf_mm_block_t *b) -{ - /* ...wipe out least-significant bit from node color */ - return (b->l_node.color & ~1); -} - -/* ...increase block length */ -static inline u32 xf_mm_block_length_add(xf_mm_block_t *b, u32 size) -{ - /* ...return exact block length after increase */ - return ((b->l_node.color += size) & ~1); -} - -/* ...decrease block length */ -static inline u32 xf_mm_block_length_sub(xf_mm_block_t *b, u32 size) -{ - /* ...return exact block length after decrease */ - return ((b->l_node.color -= size) & ~1); -} - -/******************************************************************************* - * Internal functions - ******************************************************************************/ - -/* ...find best-match node given requested size */ -static inline xf_mm_block_t * xf_mm_find_by_size(xf_mm_pool_t *pool, u32 size) -{ - rb_tree_t *tree = &pool->l_map; - rb_idx_t p_idx, t_idx; - - /* ...find first block having length greater than requested */ - for (p_idx = rb_root(tree); p_idx != rb_null(tree); p_idx = rb_right(tree, p_idx)) - { - xf_mm_block_t *b = container_of(p_idx, xf_mm_block_t, l_node); - - /* ...break upon finding first matching candidate */ - if (!xf_mm_block_length_less(b, size)) - break; - } - - /* ...bail out if haven't found a block with sufficient size */ - if (p_idx == rb_null(tree)) - return NULL; - - /* ...try to find better match in left subtree */ - for (t_idx = rb_left(tree, p_idx); t_idx != rb_null(tree); ) - { - xf_mm_block_t *b = container_of(t_idx, xf_mm_block_t, l_node); - - /* ...check the size of the block */ - if (!xf_mm_block_length_less(b, size)) - { - /* ...update best match */ - p_idx = t_idx; - - /* ...and check if we have anything better in left sbtree */ - t_idx = rb_left(tree, t_idx); - } - else - { - /* ...move towards higher block sizes in that subtree */ - t_idx = rb_right(tree, t_idx); - } - } - - /* ...p_idx is our best choice */ - return container_of(p_idx, xf_mm_block_t, l_node); -} - -/* ...find the neighbours of the block basing on its address */ -static void xf_mm_find_by_addr(xf_mm_pool_t *pool, void *addr, xf_mm_block_t **n) -{ - rb_tree_t *tree = &pool->a_map; - rb_idx_t p_idx, l_idx, r_idx; - - /* ...it is not possible to have exact match in this map */ - for (p_idx = rb_root(tree), l_idx = r_idx = NULL; p_idx != rb_null(tree); ) - { - /* ...only "is less than" comparison is valid (as "a_node" pointer is biased) */ - if ((u32)p_idx < (u32)addr) - { - /* ...update lower neighbour */ - l_idx = p_idx; - - /* ...and move towards higher addresses */ - p_idx = rb_right(tree, p_idx); - } - else - { - /* ...update higher neighbour */ - r_idx = p_idx; - - /* ...and move towards lower addresses */ - p_idx = rb_left(tree, p_idx); - } - } - - /* ...translate nodes into blocks */ - n[0] = (l_idx ? container_of(l_idx, xf_mm_block_t, a_node) : NULL); - n[1] = (r_idx ? container_of(r_idx, xf_mm_block_t, a_node) : NULL); -} - -/* ...insert the block into L-map */ -static void xf_mm_insert_size(xf_mm_pool_t *pool, xf_mm_block_t *b, u32 size) -{ - rb_tree_t *tree = &pool->l_map; - rb_idx_t p_idx, t_idx; - - /* ...find the parent node for the next block */ - for (p_idx = rb_root(tree); p_idx != rb_null(tree); p_idx = t_idx) - { - /* ...check for the size */ - if (xf_mm_block_length_less(container_of(p_idx, xf_mm_block_t, l_node), size)) - { - /* ...move towards higher addresses */ - if ((t_idx = rb_right(tree, p_idx)) == rb_null(tree)) - { - /* ...node becomes a right child of parent p */ - rb_set_right(tree, p_idx, &b->l_node); - break; - } - } - else - { - /* ...move towards lower addresses (ok if exact size match is found) */ - if ((t_idx = rb_left(tree, p_idx)) == rb_null(tree)) - { - /* ...node becomes a left child of parent p */ - rb_set_left(tree, p_idx, &b->l_node); - break; - } - } - } - - /* ...insert node into tree */ - rb_insert(tree, &b->l_node, p_idx); -} - -/* ...insert the block into A-map */ -static void xf_mm_insert_addr(xf_mm_pool_t *pool, xf_mm_block_t *b) -{ - rb_tree_t *tree = &pool->a_map; - rb_idx_t p_idx, t_idx; - - /* ...find the parent node for the next block */ - for (p_idx = rb_root(tree); p_idx != rb_null(tree); p_idx = t_idx) - { - /* ...check for the address (only "is less than" comparison is valid) */ - if ((u32)p_idx < (u32)b) - { - /* ...move towards higher addresses */ - if ((t_idx = rb_right(tree, p_idx)) == rb_null(tree)) - { - /* ...node becomes a right child of parent p */ - rb_set_right(tree, p_idx, &b->a_node); - break; - } - } - else - { - /* ...move towards lower addresses (by design there cannot be exact match) */ - if ((t_idx = rb_left(tree, p_idx)) == rb_null(tree)) - { - /* ...node becomes a left child of parent p */ - rb_set_left(tree, p_idx, &b->a_node); - break; - } - } - } - - /* ...insert node into tree */ - rb_insert(tree, &b->a_node, p_idx); -} - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...block allocation */ -void * xf_mm_alloc(xf_mm_pool_t *pool, u32 size) -{ - xf_mm_block_t *b; - - /* ...find best-fit free block */ - XF_CHK_ERR(b = xf_mm_find_by_size(pool, size), NULL); - - /* ...remove the block from the L-map */ - rb_delete(&pool->l_map, &b->l_node); - - /* ...check if the size is exactly the same as requested */ - if ((size = xf_mm_block_length_sub(b, size)) == 0) - { - /* ...the block needs to be removed from the A-map as well */ - rb_delete(&pool->a_map, &b->a_node); - - /* ...entire block goes to user */ - return (void *) b; - } - else - { - /* ...insert the block into L-map */ - xf_mm_insert_size(pool, b, size); - - /* ...A-map remains intact; tail of the block goes to user */ - return (void *) b + size; - } -} - -/* ...block deallocation */ -void xf_mm_free(xf_mm_pool_t *pool, void *addr, u32 size) -{ - xf_mm_block_t *b = xf_mm_block_init(addr, size); - xf_mm_block_t *n[2]; - - /* ...find block neighbours in A-map */ - xf_mm_find_by_addr(pool, addr, n); - - /* ...check if we can merge block to left neighbour */ - if (n[0]) - { - if ((void *)n[0] + xf_mm_block_length(n[0]) == addr) - { - /* ...merge free block with left neighbour; delete it from L-map */ - rb_delete(&pool->l_map, &n[0]->l_node); - - /* ...adjust block length (block remains in A-map) */ - addr = (void *)(b = n[0]), size = xf_mm_block_length_add(b, size); - } - else - { - /* ...mark there is no left-merge */ - n[0] = NULL; - } - } - - /* ...check if we can merge block to right neighbour */ - if (n[1]) - { - if ((void *)n[1] == addr + size) - { - /* ...merge free block with right neighbour; delete it from L-map */ - rb_delete(&pool->l_map, &n[1]->l_node); - - /* ...adjust block length */ - size = xf_mm_block_length_add(b, xf_mm_block_length(n[1])); - - /* ...check if left merge took place as well */ - if (n[0]) - { - /* ...left neighbour covers now all three blocks; drop record from A-map */ - rb_delete(&pool->a_map, &n[1]->a_node); - } - else - { - /* ...fixup tree pointers (equivalent to remove/reinsert the same key) */ - rb_replace(&pool->a_map, &n[1]->a_node, &b->a_node); - } - } - else - { - n[1] = NULL; - } - } - - /* ...if any merge has occured, A-map is updated */ - if (n[0] == NULL && n[1] == NULL) - { - /* ...add new block into A-map */ - xf_mm_insert_addr(pool, b); - } - - /* ...add (new or adjusted) block into L-map */ - xf_mm_insert_size(pool, b, size); -} - -/* ...initialize memory allocator */ -int xf_mm_init(xf_mm_pool_t *pool, void *addr, u32 size) -{ - /* ...check pool alignment validity */ - XF_CHK_ERR(((u32)addr & (sizeof(xf_mm_block_t) - 1)) == 0, -EINVAL); - - /* ...check pool size validity */ - XF_CHK_ERR(((size) & (sizeof(xf_mm_block_t) - 1)) == 0, -EINVAL); - - /* ...set pool parameters (need that stuff at all? - tbd) */ - pool->addr = addr, pool->size = size; - - /* ...initialize rb-trees */ - rb_init(&pool->l_map), rb_init(&pool->a_map); - - /* ..."free" the entire block */ - xf_mm_free(pool, addr, size); - - TRACE(INIT, _b("memory allocator initialized: [%p..%p)"), addr, addr + size); - - return 0; -} diff --git a/hifi/xaf/hifi-dpf/core/xf-msg.c b/hifi/xaf/hifi-dpf/core/xf-msg.c deleted file mode 100644 index 4253e1e3..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-msg.c +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-msg.c - * - * Message/message pool handling - * - ******************************************************************************/ - -#define MODULE_TAG MSG - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...allocate message pool */ -int xf_msg_pool_init(xf_msg_pool_t *pool, u32 n, u32 core) -{ - u32 i; - - /* ...allocate shared memory from global pool */ - XF_CHK_ERR(pool->p = xf_mem_alloc(XF_MM(sizeof(*pool->p) * n), XF_PROXY_ALIGNMENT, core, 1), -ENOMEM); - - /* ...place all messages into single-liked list */ - for (pool->head = &pool->p[i = 0]; i < n - 1; i++) - { - /* ...set message pointer to next message in the pool */ - xf_msg_pool_item(pool, i)->next = xf_msg_pool_item(pool, i + 1); - } - - /* ...set tail of the list */ - xf_msg_pool_item(pool, i)->next = NULL; - - /* ...save pool size */ - pool->n = n; - - return 0; -} - -/* ...destroy memory pool */ -void xf_msg_pool_destroy(xf_msg_pool_t *pool, u32 core) -{ - /* ...release pool memory (from shared local-IPC memory) */ - xf_mem_free(pool->p, XF_MM(sizeof(*pool->p) * pool->n), core, 1); -} - -/* ...allocate message from a pool (no concurrent access from other cores) */ -xf_message_t * xf_msg_pool_get(xf_msg_pool_t *pool) -{ - __xf_message_t *_m; - - /* ...pop message from the head of the pool */ - XF_CHK_ERR(_m = pool->head, NULL); - - /* ...advance list head */ - pool->head = (__xf_message_t *)(((xf_message_t *) _m)->next); - - /* ...debug - wipe out message "next" pointer */ - ((xf_message_t *) _m)->next = NULL; - - /* ...return properly aligned message pointer */ - return (xf_message_t *) _m; -} - -/* ...return message back to the pool (no concurrent access from other cores) */ -void xf_msg_pool_put(xf_msg_pool_t *pool, xf_message_t *m) -{ - __xf_message_t *_m = (__xf_message_t *) m; - - /* ...make sure the message is properly aligned object */ - BUG(!XF_IS_ALIGNED(_m), _x("Corrupted message pointer: %p"), _m); - - /* ...make sure it is returned to the same pool (need a length for that - tbd) */ - BUG(!xf_msg_from_pool(pool, m) < 0, _x("Bad pool/message: %p/%p"), pool->p, _m); - - /* ...place message into the head */ - m->next = (xf_message_t *) pool->head; - - /* ...advance pool head */ - pool->head = _m; -} diff --git a/hifi/xaf/hifi-dpf/core/xf-sched.c b/hifi/xaf/hifi-dpf/core/xf-sched.c deleted file mode 100644 index cc1b4e8d..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-sched.c +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-sched.c - * - * Non-preemptive earliest-deadline-first scheduler - * - ******************************************************************************/ - -#define MODULE_TAG SCHED - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(DEBUG, 1); - -/******************************************************************************* - * Global functions definitions - ******************************************************************************/ - -/* ...place task into scheduler queue */ -void xf_sched_put(xf_sched_t *sched, xf_task_t *t, u32 ts) -{ - rb_tree_t *tree = (rb_tree_t *)sched; - rb_node_t *node = (rb_node_t *)t; - rb_idx_t p_idx, t_idx; - u32 _ts; - - /* ...set scheduling timestamp */ - xf_task_timestamp_set(t, ts); - - /* ...find a place in the tree where the message should be inserted */ - for (p_idx = rb_root(tree); p_idx != rb_null(tree); p_idx = t_idx) - { - /* ...get timestamp of the p_idx */ - _ts = xf_task_timestamp((xf_task_t *)p_idx); - - /* ...ordering respects FIFO order of messages with same timestamp */ - if (xf_timestamp_before(ts, _ts)) - { - if ((t_idx = rb_left(tree, p_idx)) == rb_null(tree)) - { - /* ...p_idx is a direct successor of the message */ - rb_set_left(tree, p_idx, node); - - /* ...adjust head of the tree if needed */ - if (p_idx == rb_cache(tree)) goto insert_head; - else goto insert; - } - } - else - { - if ((t_idx = rb_right(tree, p_idx)) == rb_null(tree)) - { - /* ...p_idx is a direct predeccessor of the message */ - rb_set_right(tree, p_idx, node); - - goto insert; - } - } - } - -insert_head: - /* ...adjust scheduler head element */ - rb_set_cache(tree, node); - -insert: - /* ...insert item and rebalance the tree */ - rb_insert(tree, node, p_idx); - - /* ...head cannot be NULL */ - BUG(rb_cache(tree) == rb_null(tree), _x("Invalid scheduler state")); - - TRACE(DEBUG, _b("in: %x:[%p] (ts:%x)"), ts, node, xf_sched_timestamp(sched)); -} - -/* ...get first item from the scheduler */ -xf_task_t * xf_sched_get(xf_sched_t *sched) -{ - rb_tree_t *tree = (rb_tree_t *)sched; - rb_idx_t n_idx, t_idx; - u32 ts; - - /* ...head of the tree is cached; replace it with its parent (direct successor) */ - if ((n_idx = rb_cache(tree)) == rb_null(tree)) - { - /* ...tree is empty; bail out */ - return NULL; - } - else - { - /* ...delete current node and rebalance the tree */ - t_idx = rb_delete(tree, n_idx), rb_set_cache(tree, t_idx); - - /* ...get task timestamp */ - ts = xf_task_timestamp((xf_task_t *)n_idx); - - /* ...advance scheduler timestamp */ - xf_sched_timestamp_set(sched, ts); - - TRACE(DEBUG, _b("out: %x:[%p]"), ts, n_idx); - - /* ...return task */ - return (xf_task_t *)n_idx; - } -} - -/* ...cancel specified task execution (must be scheduled!) */ -void xf_sched_cancel(xf_sched_t *sched, xf_task_t *t) -{ - rb_tree_t *tree = (rb_tree_t *)sched; - rb_idx_t n_idx = t; - rb_idx_t t_idx; - - /* ...delete message from tree */ - t_idx = rb_delete(tree, n_idx); - - /* ...adjust head if that was the first message */ - (n_idx == rb_cache(tree) ? rb_set_cache(tree, t_idx), 1 : 0); -} - -/* ...initialize scheduler data */ -void xf_sched_init(xf_sched_t *sched) -{ - rb_init((rb_tree_t *)sched); -} diff --git a/hifi/xaf/hifi-dpf/core/xf-shmem.c b/hifi/xaf/hifi-dpf/core/xf-shmem.c deleted file mode 100644 index 15d3b1d9..00000000 --- a/hifi/xaf/hifi-dpf/core/xf-shmem.c +++ /dev/null @@ -1,350 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-shmem.c - * - * DSP shared memory interface implementation - * - ******************************************************************************/ - -#define MODULE_TAG SHMEM - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing tags - ******************************************************************************/ - -/* ...general initialization sequence */ -TRACE_TAG(INIT, 1); - -/* ...interface status change */ -TRACE_TAG(EXEC, 0); - -/* ...command reception */ -TRACE_TAG(CMD, 1); - -/* ...response generation */ -TRACE_TAG(RSP, 1); - -#ifdef XAF_PROFILE_DSP -#include "xa_profiler.h" -#endif -/******************************************************************************* - * Local constants definitions - ******************************************************************************/ - -/* ...local interface status change flag */ -#define XF_PROXY_STATUS_LOCAL (1 << 0) - -/* ...remote status change notification flag */ -#define XF_PROXY_STATUS_REMOTE (1 << 1) - -/******************************************************************************* - * Internal helpers - ******************************************************************************/ - -/* ...put message into proxy queue */ -static inline void xf_msg_proxy_put(xf_message_t *m) -{ - u32 dst = XF_MSG_DST_CORE(m->id); - u32 src = XF_MSG_SRC_CORE(m->id); - xf_core_rw_data_t *rw = XF_CORE_RW_DATA(dst); - int first; - - /* ...get an access to shared rw-memory (we are running on "source" core) */ - xf_mutex_lock(src); - - /* ...assure memory coherency if needed */ - if (XF_REMOTE_IPC_NON_COHERENT) - { - /* ...invalidate rw-shared memory region */ - XF_PROXY_INVALIDATE(rw, sizeof(*rw)); - - /* ...put message into shared queue */ - first = xf_msg_enqueue(&rw->remote, m); - - /* ...flush both message and shared queue data */ - XF_PROXY_FLUSH(rw, sizeof(*rw)), XF_PROXY_FLUSH(m, sizeof(*m)); - } - else - { - /* ...no memory coherency concerns; just place a message in the queue */ - first = xf_msg_enqueue(&rw->remote, m); - } - - /* ...release rw-memory region lock */ - xf_mutex_unlock(src); - - /* ...assert IPI interrupt on target ("destination") core if needed */ - if (first && (dst ^ src)) - { - xf_ipi_assert(dst); - } -} - -/* ...retrieve message from proxy queue */ -static inline xf_message_t * xf_msg_proxy_get(u32 core) -{ - xf_core_rw_data_t *rw = XF_CORE_RW_DATA(core); - xf_message_t *m; - - /* ...retrieve message from queue in atomic fashion */ - xf_mutex_lock(core); - - /* ...assure memory coherency if needed */ - if (XF_REMOTE_IPC_NON_COHERENT) - { - /* ...invalidate rw-memory */ - XF_PROXY_INVALIDATE(rw, sizeof(*rw)); - - /* ...dequeue message from response queue */ - m = xf_msg_dequeue(&rw->remote); - - /* ...flush rw memory */ - XF_PROXY_FLUSH(rw, sizeof(*rw)); - - /* ...invalidate message data if found */ - (m ? XF_PROXY_INVALIDATE(m, sizeof(*m)) : 0); - } - else - { - /* ...just dequeue message from response queue */ - m = xf_msg_dequeue(&rw->remote); - } - - /* ...release the rw-lock */ - xf_mutex_unlock(core); - - return m; -} - -/******************************************************************************* - * Internal functions definitions - ******************************************************************************/ - -/* ...retrieve all incoming commands from shared memory ring-buffer */ -static u32 xf_shmem_process_input(u32 core) -{ - xf_message_t *m; - u32 read_idx; - u32 write_idx; - u32 status = 0; - - /* ...get current value of write pointer */ - read_idx = XF_PROXY_READ(core, cmd_read_idx); - write_idx = XF_PROXY_READ(core, cmd_write_idx); - - TRACE(EXEC, _b("Command queue: write = %x / read = %x"), write_idx, read_idx); - - /* ...process all committed commands */ - while (!XF_QUEUE_EMPTY(read_idx, write_idx)) - { - xf_proxy_message_t *command; - - /* ...allocate message; the call should not fail */ - if ((m = xf_msg_pool_get(&XF_CORE_RO_DATA(core)->pool)) == NULL) - break; - - /* ...if queue was full, set global proxy update flag */ - if (XF_QUEUE_FULL(read_idx, write_idx)) - status |= XF_PROXY_STATUS_REMOTE | XF_PROXY_STATUS_LOCAL; - else - status |= XF_PROXY_STATUS_LOCAL; - - /* ...get oldest not processed command */ - command = XF_PROXY_COMMAND(core, XF_QUEUE_IDX(read_idx)); - - /* ...synchronize memory contents */ - XF_PROXY_INVALIDATE(command, sizeof(*command)); - - /* ...fill message parameters */ - m->id = command->session_id; - m->opcode = command->opcode; - m->length = command->length; - m->buffer = xf_ipc_a2b(core, command->address); - TRACE(CMD, _b("C[%x]:(%x,%u,%p)"), m->id, m->opcode, m->length, m->buffer); - - /* ...invalidate message buffer contents as required - not here - tbd */ - (XF_OPCODE_CDATA(m->opcode) ? XF_PROXY_INVALIDATE(m->buffer, m->length) : 0); - - /* ...advance local reading index copy */ - read_idx = XF_QUEUE_ADVANCE_IDX(read_idx); - - /* ...update shadow copy of reading index */ - XF_PROXY_WRITE(core, cmd_read_idx, read_idx); - - /* ...and schedule message execution on proper core */ - xf_msg_submit(m); - } - - return status; -} - -/* ...send out all pending outgoing responses to the shared memory ring-buffer */ -static u32 xf_shmem_process_output(u32 core) -{ - xf_message_t *m; - u32 read_idx; - u32 write_idx; - u32 status = 0; - - /* ...get current value of peer read pointer */ - write_idx = XF_PROXY_READ(core, rsp_write_idx); - read_idx = XF_PROXY_READ(core, rsp_read_idx); - - TRACE(EXEC, _b("Response queue: write = %08X / read = %08X"), write_idx, read_idx); - - /* ...while we have response messages and there's space to write out one */ - while (!XF_QUEUE_FULL(read_idx, write_idx)) - { - xf_proxy_message_t *response; - - /* ...remove message from internal queue */ - if ((m = xf_msg_proxy_get(core)) == NULL) - break; - - /* ...notify remote interface each time we send it a message (only if it was empty?) */ - status = XF_PROXY_STATUS_REMOTE | XF_PROXY_STATUS_LOCAL; - -#if 0 - /* ...need to decide on best strategy - tbd */ - if (XF_QUEUE_EMPTY(read_idx, write_idx)) - status |= XF_PROXY_STATUS_REMOTE | XF_PROXY_STATUS_LOCAL; - else - status |= XF_PROXY_STATUS_LOCAL; -#endif - - /* ...flush message buffer contents to main memory as required - too late - different core - tbd */ - (XF_OPCODE_RDATA(m->opcode) ? XF_PROXY_FLUSH(m->buffer, m->length) : 0); - - /* ...find place in a queue for next response */ - response = XF_PROXY_RESPONSE(core, XF_QUEUE_IDX(write_idx)); - - /* ...put the response message fields */ - response->session_id = m->id; - response->opcode = m->opcode; - response->length = m->length; - response->address = xf_ipc_b2a(core, m->buffer); - /* ...flush the content of the caches to main memory */ - XF_PROXY_FLUSH(response, sizeof(*response)); - -#ifdef XAF_PROFILE_DSP - if((m->opcode == XF_FILL_THIS_BUFFER)) - { - if((m->length != 0) && (m->length != 20)) - { - prof.g_output_bytes += (unsigned long)m->length; - } - else if (m->length == 20) - { - /* Profiler re-initialization */ - INIT_XA_PROFILER(prof,"DSP core"); - - /* update stream params on re-init */ - xf_start_msg_t *sm = (xf_start_msg_t *)m->buffer; - prof.sample_rate = sm->sample_rate; - prof.channels = sm->channels; - prof.pcm_width = sm->pcm_width; - } - } -#endif - TRACE(RSP, _b("R[%x]:(%x,%u,%p)"), m->id, m->opcode, m->length, m->buffer); - - /* ...return message back to the pool */ - xf_msg_pool_put(&XF_CORE_RO_DATA(core)->pool, m); - - /* ...advance local writing index copy */ - write_idx = XF_QUEUE_ADVANCE_IDX(write_idx); - - /* ...update shared copy of queue write pointer */ - XF_PROXY_WRITE(core, rsp_write_idx, write_idx); - } - - /* ...return interface status change flags */ - return status; -} - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...process local/remote shared memory interface status change */ -void xf_shmem_process_queues(u32 core) -{ - u32 status; - - do - { - /* ...acknowledge/clear any pending incoming interrupt */ - XF_PROXY_SYNC_PEER(core); - - /* ...send out pending response messages (frees message buffers, so do it first) */ - status = xf_shmem_process_output(core); - - /* ...receive and forward incoming command messages (allocates message buffers) */ - status |= xf_shmem_process_input(core); - - /* ...assert remote mailbox interrupt if global update bit is set */ - if (status & XF_PROXY_STATUS_REMOTE) - { - XF_PROXY_NOTIFY_PEER(core); - } - } - while (status); -} - -/* ...completion callback for message originating from remote proxy */ -void xf_msg_proxy_complete(xf_message_t *m) -{ - /* ...place message into proxy response queue */ - xf_msg_proxy_put(m); -} - -/* ...initialize shared memory interface (DSP side) */ -int xf_shmem_init(u32 core) -{ - xf_core_rw_data_t *rw = XF_CORE_RW_DATA(core); - xf_core_ro_data_t *ro = XF_CORE_RO_DATA(core); - - /* ...initialize local/remote message queues */ - xf_msg_queue_init(&rw->local); - xf_msg_queue_init(&rw->remote); - - /* ...initialize global message list */ - XF_CHK_API(xf_msg_pool_init(&ro->pool, XF_CFG_MESSAGE_POOL_SIZE, core)); - - /* ...flush memory content as needed */ - (XF_REMOTE_IPC_NON_COHERENT ? XF_PROXY_FLUSH(rw, sizeof(*rw)) : 0); - - /* ...system-specific initialization of IPC layer */ - XF_CHK_API(xf_ipc_init(core)); - - TRACE(INIT, _b("SHMEM-%u subsystem initialized"), core); - - return 0; -} diff --git a/hifi/xaf/hifi-dpf/include/audio/xa-audio-decoder-api.h b/hifi/xaf/hifi-dpf/include/audio/xa-audio-decoder-api.h deleted file mode 100644 index 797bf231..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa-audio-decoder-api.h +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-audio-decoder-api.h - * - * Generic audio decoder API - * - ******************************************************************************/ - -#ifndef __XA_ADEC_API_H__ -#define __XA_ADEC_API_H__ - -/* ...includes */ -#include "xa_type_def.h" -#include "xa_error_standards.h" -#include "xa_apicmd_standards.h" -#include "xa_memory_standards.h" - -/* ...generic audio-decoder configuration parameters */ -enum xa_config_param_codec { - XA_CODEC_CONFIG_PARAM_CHANNELS = 0x10000 + 0, - XA_CODEC_CONFIG_PARAM_SAMPLE_RATE = 0x10000 + 1, - XA_CODEC_CONFIG_PARAM_PCM_WIDTH = 0x10000 + 2, - XA_CODEC_CONFIG_PARAM_PRODUCED = 0x10000 + 3 -}; - -/* ...ports indices */ -enum xa_codec_ports { - XA_CODEC_INPUT_PORT = 0, - XA_CODEC_OUTPUT_PORT = 1 -}; - -/* ...non-fatal execution errors */ -enum -{ - XA_CODEC_EXEC_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_GENERIC, 0) -}; - -/* ...fatal execution errors */ -enum -{ - XA_CODEC_EXEC_SEQUENCE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_GENERIC, 0), - XA_CODEC_EXEC_MISBEHAVING = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_GENERIC, 1), -}; - -#endif diff --git a/hifi/xaf/hifi-dpf/include/audio/xa-mixer-api.h b/hifi/xaf/hifi-dpf/include/audio/xa-mixer-api.h deleted file mode 100644 index 0de1745d..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa-mixer-api.h +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-mixer-api.h - * - * Mixer component API - * - ******************************************************************************/ - -#ifndef __XA_MIXER_API_H__ -#define __XA_MIXER_API_H__ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xa_type_def.h" -#include "xa_error_standards.h" -#include "xa_apicmd_standards.h" -#include "xa_memory_standards.h" - -/******************************************************************************* - * Constants definitions - ******************************************************************************/ - -/* ...mixer-specific configuration parameters */ -enum xa_config_param_mixer { - XA_MIXER_CONFIG_PARAM_INPUT_TRACKS = 0, - XA_MIXER_CONFIG_PARAM_PCM_WIDTH = 1, - XA_MIXER_CONFIG_PARAM_CHANNELS = 2, - XA_MIXER_CONFIG_PARAM_SAMPLE_RATE = 4, - XA_MIXER_CONFIG_PARAM_FRAME_SIZE = 5, - XA_MIXER_CONFIG_PARAM_BUFFER_SIZE = 6, - XA_MIXER_CONFIG_PARAM_VOLUME = 7, - XA_MIXER_CONFIG_PARAM_NUM = 8 -}; - -/* ...component identifier (informative) */ -#define XA_CODEC_MIXER 1 - -/* ...global limitation - maximal mixer track number */ -#define XA_MIXER_MAX_TRACK_NUMBER 4 - -/* ...volume representation */ -#define __XA_MIXER_VOLUME(v) \ - ({ u32 __v = (u32)((v) * (1 << 12)); (__v > 0xFFFF ? __v = 0xFFFF : 0); (u16)__v; }) - -/* ...mixer volume setting command encoding */ -#define XA_MIXER_VOLUME(track, channel, volume) \ - (__XA_MIXER_VOLUME(volume) | ((track) << 16) | ((channel) << 20)) - -/******************************************************************************* - * Class 0: API Errors - ******************************************************************************/ - -#define XA_MIXER_API_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_api, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_API_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_api_mixer { - XA_MIXER_API_NONFATAL_MAX = XA_MIXER_API_NONFATAL(0) -}; - -enum xa_error_fatal_api_mixer { - XA_MIXER_API_FATAL_MAX = XA_MIXER_API_FATAL(0) -}; - -/******************************************************************************* - * Class 1: Configuration Errors - ******************************************************************************/ - -#define XA_MIXER_CONFIG_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_CONFIG_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_config_mixer { - XA_MIXER_CONFIG_NONFATAL_RANGE = XA_MIXER_CONFIG_NONFATAL(0), - XA_MIXER_CONFIG_NONFATAL_STATE = XA_MIXER_CONFIG_NONFATAL(1), - XA_MIXER_CONFIG_NONFATAL_MAX = XA_MIXER_CONFIG_NONFATAL(2) -}; - -enum xa_error_fatal_config_mixer { - XA_MIXER_CONFIG_FATAL_RANGE = XA_MIXER_CONFIG_FATAL(0), - XA_MIXER_CONFIG_FATAL_TRACK_STATE = XA_MIXER_CONFIG_FATAL(0 + XA_MIXER_CONFIG_NONFATAL_MAX), - XA_MIXER_CONFIG_FATAL_MAX = XA_MIXER_CONFIG_FATAL(1) -}; - -/******************************************************************************* - * Class 2: Execution Class Errors - ******************************************************************************/ - -#define XA_MIXER_EXEC_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_EXEC_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_execute_mixer { - XA_MIXER_EXEC_NONFATAL_STATE = XA_MIXER_EXEC_NONFATAL(0), - XA_MIXER_EXEC_NONFATAL_NO_DATA = XA_MIXER_EXEC_NONFATAL(1), - XA_MIXER_EXEC_NONFATAL_INPUT = XA_MIXER_EXEC_NONFATAL(2), - XA_MIXER_EXEC_NONFATAL_OUTPUT = XA_MIXER_EXEC_NONFATAL(3), - XA_MIXER_EXEC_NONFATAL_MAX = XA_MIXER_EXEC_NONFATAL(4) -}; - -enum xa_error_fatal_execute_mixer { - XA_MIXER_EXEC_FATAL_STATE = XA_MIXER_EXEC_FATAL(0), - XA_MIXER_EXEC_FATAL_INPUT = XA_MIXER_EXEC_FATAL(1), - XA_MIXER_EXEC_FATAL_OUTPUT = XA_MIXER_EXEC_FATAL(2), - XA_MIXER_EXEC_FATAL_MAX = XA_MIXER_EXEC_FATAL(3) -}; - -/******************************************************************************* - * API function definition (tbd) - ******************************************************************************/ - -#if defined(USE_DLL) && defined(_WIN32) -#define DLL_SHARED __declspec(dllimport) -#elif defined (_WINDLL) -#define DLL_SHARED __declspec(dllexport) -#else -#define DLL_SHARED -#endif - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ -DLL_SHARED xa_codec_func_t xa_mixer; -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* __XA_MIXER_API_H__ */ diff --git a/hifi/xaf/hifi-dpf/include/audio/xa_apicmd_standards.h b/hifi/xaf/hifi-dpf/include/audio/xa_apicmd_standards.h deleted file mode 100644 index eb1b78e1..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa_apicmd_standards.h +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_API_CMD_STANDARDS_H__ -#define __XA_API_CMD_STANDARDS_H__ - -/*****************************************************************************/ -/* Standard API commands */ -/*****************************************************************************/ - -enum xa_api_cmd_generic { - XA_API_CMD_GET_LIB_ID_STRINGS = 0x0001, - - XA_API_CMD_GET_API_SIZE = 0x0002, - XA_API_CMD_INIT = 0x0003, - - XA_API_CMD_SET_CONFIG_PARAM = 0x0004, - XA_API_CMD_GET_CONFIG_PARAM = 0x0005, - - XA_API_CMD_GET_MEMTABS_SIZE = 0x0006, - XA_API_CMD_SET_MEMTABS_PTR = 0x0007, - XA_API_CMD_GET_N_MEMTABS = 0x0008, - - XA_API_CMD_EXECUTE = 0x0009, - - XA_API_CMD_PUT_INPUT_QUERY = 0x000A, - XA_API_CMD_GET_CURIDX_INPUT_BUF = 0x000B, - XA_API_CMD_SET_INPUT_BYTES = 0x000C, - XA_API_CMD_GET_OUTPUT_BYTES = 0x000D, - XA_API_CMD_INPUT_OVER = 0x000E, - - XA_API_CMD_GET_MEM_INFO_SIZE = 0x0010, - XA_API_CMD_GET_MEM_INFO_ALIGNMENT = 0x0011, - XA_API_CMD_GET_MEM_INFO_TYPE = 0x0012, - XA_API_CMD_GET_MEM_INFO_PLACEMENT = 0x0013, - XA_API_CMD_GET_MEM_INFO_PRIORITY = 0x0014, - XA_API_CMD_SET_MEM_PTR = 0x0015, - XA_API_CMD_SET_MEM_INFO_SIZE = 0x0016, - XA_API_CMD_SET_MEM_PLACEMENT = 0x0017, - - XA_API_CMD_GET_N_TABLES = 0x0018, - XA_API_CMD_GET_TABLE_INFO_SIZE = 0x0019, - XA_API_CMD_GET_TABLE_INFO_ALIGNMENT = 0x001A, - XA_API_CMD_GET_TABLE_INFO_PRIORITY = 0x001B, - XA_API_CMD_SET_TABLE_PTR = 0x001C, - XA_API_CMD_GET_TABLE_PTR = 0x001D -}; - -/*****************************************************************************/ -/* Standard API command indices */ -/*****************************************************************************/ - -enum xa_cmd_type_generic { - /* XA_API_CMD_GET_LIB_ID_STRINGS indices */ - XA_CMD_TYPE_LIB_NAME = 0x0100, - XA_CMD_TYPE_LIB_VERSION = 0x0200, - XA_CMD_TYPE_API_VERSION = 0x0300, - - /* XA_API_CMD_INIT indices */ - XA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS = 0x0100, - XA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS = 0x0200, - XA_CMD_TYPE_INIT_PROCESS = 0x0300, - XA_CMD_TYPE_INIT_DONE_QUERY = 0x0400, - - /* XA_API_CMD_EXECUTE indices */ - XA_CMD_TYPE_DO_EXECUTE = 0x0100, - XA_CMD_TYPE_DONE_QUERY = 0x0200, - XA_CMD_TYPE_DO_RUNTIME_INIT = 0x0300 -}; - - -/*****************************************************************************/ -/* Standard API configuration parameters */ -/*****************************************************************************/ - -enum xa_config_param_generic { - XA_CONFIG_PARAM_CUR_INPUT_STREAM_POS = 0x0100, - XA_CONFIG_PARAM_GEN_INPUT_STREAM_POS = 0x0200, -}; - -#endif /* __XA_API_CMD_STANDARDS_H__ */ diff --git a/hifi/xaf/hifi-dpf/include/audio/xa_error_standards.h b/hifi/xaf/hifi-dpf/include/audio/xa_error_standards.h deleted file mode 100644 index 1b67b52f..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa_error_standards.h +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_ERROR_STANDARDS_H__ -#define __XA_ERROR_STANDARDS_H__ - -/*****************************************************************************/ -/* File includes */ -/* xa_type_def.h */ -/*****************************************************************************/ - -/*****************************************************************************/ -/* Constant hash defines */ -/*****************************************************************************/ -#define XA_NO_ERROR 0 -#define XA_FATAL_ERROR 0x80000000 - -enum xa_error_severity { - xa_severity_nonfatal = 0, - xa_severity_fatal = 0xffffffff -}; - -enum xa_error_class { - xa_class_api = 0, - xa_class_config = 1, - xa_class_execute = 2, - xa_class_proxy = 3 -}; - -#define XA_CODEC_GENERIC 0 - -#define XA_ERROR_CODE(severity, class, codec, index) ((severity << 15) | (class << 11) | (codec << 6) | index) -#define XA_ERROR_SEVERITY(code) (((code) & XA_FATAL_ERROR) != 0) -#define XA_ERROR_CLASS(code) (((code) >> 11) & 0x0f) -#define XA_ERROR_CODEC(code) (((code) >> 6) & 0x1f) -#define XA_ERROR_SUBCODE(code) (((code) >> 0) & 0x3f) - -/* Our convention is that only api-class errors can be generic ones. */ - -/*****************************************************************************/ -/* Class 0: API Errors */ -/*****************************************************************************/ -/* Non Fatal Errors */ -/* (none) */ -/* Fatal Errors */ -enum xa_error_fatal_api_generic { - XA_API_FATAL_MEM_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 0), - XA_API_FATAL_MEM_ALIGN = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 1), - XA_API_FATAL_INVALID_CMD = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 2), - XA_API_FATAL_INVALID_CMD_TYPE = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 3) -}; - -#endif /* __XA_ERROR_STANDARDS_H__ */ diff --git a/hifi/xaf/hifi-dpf/include/audio/xa_memory_standards.h b/hifi/xaf/hifi-dpf/include/audio/xa_memory_standards.h deleted file mode 100644 index 27ec455f..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa_memory_standards.h +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_MEMORY_STANDARDS_H__ -#define __XA_MEMORY_STANDARDS_H__ - -/*****************************************************************************/ -/* Constant hash defines */ -/*****************************************************************************/ -/* when you don't need alignment, pass this to memory library */ -#define XA_MEM_NO_ALIGN 0x01 - -/* standard memory types */ -/* to be used inter frames */ -#define XA_MEMTYPE_PERSIST 0x00 -/* read write, to be used intra frames */ -#define XA_MEMTYPE_SCRATCH 0x01 -/* read only memory, intra frame */ -#define XA_MEMTYPE_INPUT 0x02 -/* read-write memory, for usable output, intra frame */ -#define XA_MEMTYPE_OUTPUT 0x03 -/* readonly memory, inter frame */ -#define XA_MEMTYPE_TABLE 0x04 -/* input buffer before mem tabs allocation */ -#define XA_MEMTYPE_PRE_FRAME_INPUT 0x05 -/* input buffer before mem tabs allocation */ -#define XA_MEMTYPE_PRE_FRAME_SCRATCH 0x06 -/* for local variables */ -#define XA_MEMTYPE_AUTO_VAR 0x80 - -/* standard memory priorities */ -#define XA_MEMPRIORITY_ANYWHERE 0x00 -#define XA_MEMPRIORITY_LOWEST 0x01 -#define XA_MEMPRIORITY_LOW 0x02 -#define XA_MEMPRIORITY_NORM 0x03 -#define XA_MEMPRIORITY_ABOVE_NORM 0x04 -#define XA_MEMPRIORITY_HIGH 0x05 -#define XA_MEMPRIORITY_HIGHER 0x06 -#define XA_MEMPRIORITY_CRITICAL 0x07 - -/* standard memory placements */ -/* placement is defined by 64 bits */ - -#define XA_MEMPLACE_FAST_RAM_0 0x000001 -#define XA_MEMPLACE_FAST_RAM_1 0x000002 -#define XA_MEMPLACE_FAST_RAM_2 0x000004 -#define XA_MEMPLACE_FAST_RAM_3 0x000008 -#define XA_MEMPLACE_FAST_RAM_4 0x000010 -#define XA_MEMPLACE_FAST_RAM_5 0x000020 -#define XA_MEMPLACE_FAST_RAM_6 0x000040 -#define XA_MEMPLACE_FAST_RAM_7 0x000080 - -#define XA_MEMPLACE_INT_RAM_0 0x000100 -#define XA_MEMPLACE_INT_RAM_1 0x000200 -#define XA_MEMPLACE_INT_RAM_2 0x000400 -#define XA_MEMPLACE_INT_RAM_3 0x000800 -#define XA_MEMPLACE_INT_RAM_4 0x001000 -#define XA_MEMPLACE_INT_RAM_5 0x002000 -#define XA_MEMPLACE_INT_RAM_6 0x004000 -#define XA_MEMPLACE_INT_RAM_7 0x008000 - -#define XA_MEMPLACE_EXT_RAM_0 0x010000 -#define XA_MEMPLACE_EXT_RAM_1 0x020000 -#define XA_MEMPLACE_EXT_RAM_2 0x040000 -#define XA_MEMPLACE_EXT_RAM_3 0x080000 -#define XA_MEMPLACE_EXT_RAM_4 0x100000 -#define XA_MEMPLACE_EXT_RAM_5 0x200000 -#define XA_MEMPLACE_EXT_RAM_6 0x400000 -#define XA_MEMPLACE_EXT_RAM_7 0x800000 - -#define XA_MEMPLACE_DONTCARE_H 0xFFFFFFFF -#define XA_MEMPLACE_DONTCARE_L 0xFFFFFFFF - -/* the simple common PC RAM */ -#define XA_PC_RAM_H 0x00000000 -#define XA_PC_RAM_L XA_MEMPLACE_EXT_RAM_0 - -#endif /* __XA_MEMORY_STANDARDS_H__ */ diff --git a/hifi/xaf/hifi-dpf/include/audio/xa_type_def.h b/hifi/xaf/hifi-dpf/include/audio/xa_type_def.h deleted file mode 100644 index e83cdd34..00000000 --- a/hifi/xaf/hifi-dpf/include/audio/xa_type_def.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_TYPE_DEF_H__ -#define __XA_TYPE_DEF_H__ - -/****************************************************************************/ -/* types type define prefix examples bytes */ -/************************ *********** ****** **************** ***** */ -typedef signed char WORD8 ;/* b WORD8 b_name 1 */ -typedef signed char * pWORD8 ;/* pb pWORD8 pb_nmae 1 */ -typedef unsigned char UWORD8 ;/* ub UWORD8 ub_count 1 */ -typedef unsigned char * pUWORD8 ;/* pub pUWORD8 pub_count 1 */ - -typedef signed short WORD16 ;/* s WORD16 s_count 2 */ -typedef signed short * pWORD16 ;/* ps pWORD16 ps_count 2 */ -typedef unsigned short UWORD16 ;/* us UWORD16 us_count 2 */ -typedef unsigned short * pUWORD16;/* pus pUWORD16 pus_count 2 */ - -typedef signed int WORD24 ;/* k WORD24 k_count 3 */ -typedef signed int * pWORD24 ;/* pk pWORD24 pk_count 3 */ -typedef unsigned int UWORD24 ;/* uk UWORD24 uk_count 3 */ -typedef unsigned int * pUWORD24;/* puk pUWORD24 puk_count 3 */ - -typedef signed int WORD32 ;/* i WORD32 i_count 4 */ -typedef signed int * pWORD32 ;/* pi pWORD32 pi_count 4 */ -typedef unsigned int UWORD32 ;/* ui UWORD32 ui_count 4 */ -typedef unsigned int * pUWORD32;/* pui pUWORD32 pui_count 4 */ - -typedef signed long long WORD40 ;/* m WORD40 m_count 5 */ -typedef signed long long * pWORD40 ;/* pm pWORD40 pm_count 5 */ -typedef unsigned long long UWORD40 ;/* um UWORD40 um_count 5 */ -typedef unsigned long long * pUWORD40;/* pum pUWORD40 pum_count 5 */ - -typedef signed long long WORD64 ;/* h WORD64 h_count 8 */ -typedef signed long long * pWORD64 ;/* ph pWORD64 ph_count 8 */ -typedef unsigned long long UWORD64 ;/* uh UWORD64 uh_count 8 */ -typedef unsigned long long * pUWORD64;/* puh pUWORD64 puh_count 8 */ - -typedef float FLOAT32 ;/* f FLOAT32 f_count 4 */ -typedef float * pFLOAT32;/* pf pFLOAT32 pf_count 4 */ -typedef double FLOAT64 ;/* d UFLOAT64 d_count 8 */ -typedef double * pFlOAT64;/* pd pFLOAT64 pd_count 8 */ - -typedef void VOID ;/* v VOID v_flag 4 */ -typedef void * pVOID ;/* pv pVOID pv_flag 4 */ - -/* variable size types: platform optimized implementation */ -//typedef signed int BOOL ;/* bool BOOL bool_true */ -//typedef unsigned int UBOOL ;/* ubool BOOL ubool_true */ -typedef signed int FLAG ;/* flag FLAG flag_false */ -typedef unsigned int UFLAG ;/* uflag FLAG uflag_false */ -typedef signed int LOOPIDX ;/* lp LOOPIDX lp_index */ -typedef unsigned int ULOOPIDX;/* ulp SLOOPIDX ulp_index */ -typedef signed int WORD ;/* lp LOOPIDX lp_index */ -typedef unsigned int UWORD ;/* ulp SLOOPIDX ulp_index */ - -typedef LOOPIDX LOOPINDEX; /* lp LOOPIDX lp_index */ -typedef ULOOPIDX ULOOPINDEX;/* ulp SLOOPIDX ulp_index */ - -#define PLATFORM_INLINE __inline - -typedef struct xa_codec_opaque { WORD32 _; } *xa_codec_handle_t; - -typedef int XA_ERRORCODE; - -typedef XA_ERRORCODE xa_codec_func_t(xa_codec_handle_t p_xa_module_obj, - WORD32 i_cmd, - WORD32 i_idx, - pVOID pv_value); - -#endif /* __XA_TYPE_DEF_H__ */ diff --git a/hifi/xaf/hifi-dpf/include/lib/mutex.h b/hifi/xaf/hifi-dpf/include/lib/mutex.h deleted file mode 100644 index 2aef0f6e..00000000 --- a/hifi/xaf/hifi-dpf/include/lib/mutex.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * mutex.h - * - * - * Implementation of "non-robust" Szymanski linear-waiting algorithm. Types of - * failures tolerated by Szymanski's "robust" algorithm are not specific for - * Xtensa DSP cluster and therefore more lightweight version of the algorithm - * is used. FIFO servicing property is of low importance, and faster/smaller - * version with linear-wait property is preferable. - * - * We assume there is just a single mutex in the system, and all communication - * variables are defined somewhere in board-specific headers and imported here - * by means of macros MUTEX_SHARED_READ/WRITE. - ******************************************************************************/ - -#ifndef __MUTEX_H -#define __MUTEX_H - -/******************************************************************************* - * Imported macros - ******************************************************************************/ - -#if !defined(MUTEX_SHARED_READ) || !defined(MUTEX_SHARED_WRITE) -#error "Macros MUTEX_SHARED_READ and/or MUTEX_SHARED_WRITE not defined" -#endif - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...acquire global mutex from i-th core */ -extern void mutex_lock(u32 i); - -/* ...release global mutex from i-th core */ -extern void mutex_unlock(u32 i); - -#endif /* __MUTEX_H */ diff --git a/hifi/xaf/hifi-dpf/include/lib/rbtree.h b/hifi/xaf/hifi-dpf/include/lib/rbtree.h deleted file mode 100644 index 7f02cdf3..00000000 --- a/hifi/xaf/hifi-dpf/include/lib/rbtree.h +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * rbtree.h - * - * Generic implmentation of red-black trees - * - *******************************************************************************/ - -#ifndef __RBTREE_H -#define __RBTREE_H - -/******************************************************************************* - * Red-black tree node definition - ******************************************************************************/ - -/* ...reference to rb-tree node */ -typedef struct rb_node *rb_idx_t; - -/* ...rb-tree node */ -typedef struct rb_node -{ - /* ...pointers to parent and two children */ - rb_idx_t parent, left, right; - - /* ...node color (least-significant-bit only) */ - u32 color; - -} rb_node_t; - -/* ...rb-tree data */ -typedef struct rb_tree_t -{ - /* ...tree sentinel node */ - rb_node_t root; - -} rb_tree_t; - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...left child accessor */ -static inline rb_idx_t rb_left(rb_tree_t *tree, rb_idx_t n_idx) -{ - return n_idx->left; -} - -/* ...right child accessor */ -static inline rb_idx_t rb_right(rb_tree_t *tree, rb_idx_t n_idx) -{ - return n_idx->right; -} - -/* ...parent node accessor */ -static inline rb_idx_t rb_parent(rb_tree_t *tree, rb_idx_t n_idx) -{ - return n_idx->parent; -} - -/* ...tree root node accessor */ -static inline rb_idx_t rb_root(rb_tree_t *tree) -{ - return rb_left(tree, &tree->root); -} - -/* ...tree data pointer accessor */ -static inline rb_idx_t rb_cache(rb_tree_t *tree) -{ - return rb_right(tree, &tree->root); -} - -/* ...tree null node */ -static inline rb_idx_t rb_null(rb_tree_t *tree) -{ - return &tree->root; -} - -/* ...get user-bits stored in node color */ -static inline u32 rb_node_data(rb_tree_t *tree, rb_idx_t n_idx) -{ - return (n_idx->color >> 1); -} - -/* ...left child assignment */ -static inline void rb_set_left(rb_tree_t *tree, rb_idx_t n_idx, rb_node_t *child) -{ - n_idx->left = child; -} - -/* ...right child assignment */ -static inline void rb_set_right(rb_tree_t *tree, rb_idx_t n_idx, rb_node_t *child) -{ - n_idx->right = child; -} - -/* ...cache tree client index */ -static inline void rb_set_cache(rb_tree_t *tree, rb_idx_t c_idx) -{ - tree->root.right = c_idx; -} - -/* ...get user-bits stored in node color */ -static inline void rb_set_node_data(rb_tree_t *tree, rb_idx_t n_idx, u32 data) -{ - n_idx->color = (n_idx->color & 0x1) | (data << 1); -} - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...initialize rb-tree */ -extern void rb_init(rb_tree_t *tree); - -/* ...insert node into tree as a child of p */ -extern void rb_insert(rb_tree_t *tree, rb_idx_t n_idx, rb_idx_t p_idx); - -/* ...replace the node with same-key value and fixup tree pointers */ -extern void rb_replace(rb_tree_t *tree, rb_idx_t n_idx, rb_idx_t t_idx); - -/* ...delete node from the tree and return its in-order predecessor/successor */ -extern rb_idx_t rb_delete(rb_tree_t *tree, rb_idx_t n_idx); - -/* ...first in-order item in the tree */ -extern rb_idx_t rb_first(rb_tree_t *tree); - -/* ...last in-order item in the tree */ -extern rb_idx_t rb_last(rb_tree_t *tree); - -/* ...forward tree iterator */ -extern rb_idx_t rb_next(rb_tree_t *tree, rb_idx_t n_idx); - -/* ...backward tree iterator */ -extern rb_idx_t rb_prev(rb_tree_t *tree, rb_idx_t n_idx); - -#endif /* __RBTREE_H */ diff --git a/hifi/xaf/hifi-dpf/include/lib/tinyput.h b/hifi/xaf/hifi-dpf/include/lib/tinyput.h deleted file mode 100644 index dadd0885..00000000 --- a/hifi/xaf/hifi-dpf/include/lib/tinyput.h +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/* $Id: //depot/dev/Cottonwood/Xtensa/OS/mpg2/tinyput.h#2 $ */ - -#include <stdarg.h> - -extern void tiny_putc(char c); -extern int tiny_puts(const char *s); -extern int tiny_atoi(const char *s); -extern int tiny_vsprintf(char *out, const char *fmt, va_list ap); -extern int tiny_sprintf(char *out, const char *fmt, ...); diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/arch_hifi330.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/arch_hifi330.h deleted file mode 100644 index 74b12220..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/arch_hifi330.h +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include <xtensa/simcall.h> -#include <xtensa/corebits.h> -#include <xtensa/config/system.h> -#include <xtensa/config/core.h> - -#ifndef __ARCH_HIFI330_H__ -#define __ARCH_HIFI330_H__ - -#ifdef __ASSEMBLER__ -#include <xtensa/coreasm.h> -#endif - -#include <xtensa/corebits.h> -#include <xtensa/config/system.h> - -/* -Align a value up to nearest n-byte boundary, where n is a power of 2. -*/ -#define ALIGNUP(n, val) (((val) + (n)-1) & -(n)) - - -/******************************************************************************* -INTERRUPT STACK FRAME FOR A THREAD OR NESTED INTERRUPT -*******************************************************************************/ -#define XT_STK_EXIT 0x00 /* (offset 0) exit point for dispatch */ -#define XT_STK_PC 0x04 /* return address */ -#define XT_STK_PS 0x08 /* at level 1 PS.EXCM is set here */ -#define XT_STK_A0 0x0C -#define XT_STK_A1 0x10 /* stack ptr before interrupt */ -#define XT_STK_A2 0x14 -#define XT_STK_A3 0x18 -#define XT_STK_A4 0x1C -#define XT_STK_A5 0x20 -#define XT_STK_A6 0x24 -#define XT_STK_A7 0x28 -#define XT_STK_A8 0x2C -#define XT_STK_A9 0x30 -#define XT_STK_A10 0x34 -#define XT_STK_A11 0x38 -#define XT_STK_A12 0x3C /* Call0 callee-save */ -#define XT_STK_A13 0x40 /* Call0 callee-save */ -#define XT_STK_A14 0x44 /* Call0 callee-save */ -#define XT_STK_A15 0x48 /* Call0 callee-save */ -#define XT_STK_SAR 0x4C - -#define XT_STK_LBEG 0x50 -#define XT_STK_LEND 0x54 -#define XT_STK_LCOUNT 0x58 -#define XT_STK_NEXT1 0x5C /* next unused offset */ - -#define XT_STK_EXTRA ALIGNUP(XCHAL_EXTRA_SA_ALIGN, XT_STK_NEXT1) - -#define XT_STK_NEXT2 (XT_STK_EXTRA + XCHAL_EXTRA_SA_SIZE) - -#define XT_STK_N_TMP 3 /* # of 4-byte temp. slots */ -#define XT_STK_TMP XT_STK_NEXT2 -#define XT_STK_NEXT3 XT_STK_TMP + (4 * XT_STK_N_TMP) -#define XT_STK_FRMSZ (ALIGNUP(0x10, XT_STK_NEXT3) + 0x20) - - -/******************************************************************************* -SIMPLE STACK FRAME FOR A THREAD -*******************************************************************************/ -#define XT_SOL_EXIT XT_STK_EXIT /* code indicates solicited frame */ -#define XT_SOL_PC 0x04 /* return address (b30-31=callinc) */ -#define XT_SOL_PS 0x08 -#define XT_SOL_NEXT 0x0c /* next unused offset */ - /* there may be some unused space here */ -#define XT_SOL_A0 ALIGNUP(0x10, XT_SOL_NEXT) -#define XT_SOL_A1 XT_SOL_A0 + 4 -#define XT_SOL_A2 XT_SOL_A1 + 4 -#define XT_SOL_A3 XT_SOL_A2 + 4 -#define XT_SOL_FRMSZ ALIGNUP(0x10, XT_SOL_A3) - - -/******************************************************************************* -CO-PROCESSOR STATE SAVE AREA FOR A THREAD -*******************************************************************************/ -#define XT_CPENABLE 0 -#define XT_CPSTORED (XT_CPENABLE + 1) -#define XT_CP0_SA ALIGNUP(XCHAL_CP0_SA_ALIGN, XT_CPSTORED + 1) -#define XT_CP1_SA ALIGNUP(XCHAL_CP1_SA_ALIGN, XT_CP0_SA + XCHAL_CP0_SA_SIZE) -#define XT_CP2_SA ALIGNUP(XCHAL_CP2_SA_ALIGN, XT_CP1_SA + XCHAL_CP1_SA_SIZE) -#define XT_CP3_SA ALIGNUP(XCHAL_CP3_SA_ALIGN, XT_CP2_SA + XCHAL_CP2_SA_SIZE) -#define XT_CP4_SA ALIGNUP(XCHAL_CP4_SA_ALIGN, XT_CP3_SA + XCHAL_CP3_SA_SIZE) -#define XT_CP5_SA ALIGNUP(XCHAL_CP5_SA_ALIGN, XT_CP4_SA + XCHAL_CP4_SA_SIZE) -#define XT_CP6_SA ALIGNUP(XCHAL_CP6_SA_ALIGN, XT_CP5_SA + XCHAL_CP5_SA_SIZE) -#define XT_CP7_SA ALIGNUP(XCHAL_CP7_SA_ALIGN, XT_CP6_SA + XCHAL_CP6_SA_SIZE) -#define XT_CP_SIZE ALIGNUP(4 , XT_CP7_SA + XCHAL_CP7_SA_SIZE) - -#ifdef __ASSEMBLER__ -/* Windowed */ -#define ENTRY(sz) entry sp, sz -#define ENTRY0 entry sp, 0x10 -#define RET(sz) retw -#define RET0 retw -#endif - -#define XT_TICK_PER_SEC 100 -#define XT_RTOS_INT_ENTER OS_IntEnter -#define XT_RTOS_INT_EXIT OS_IntExit -#define XT_RTOS_CP_STATE OS_GetTaskCoprocState - -#ifdef __ASSEMBLER__ -// typedef struct vos_tcb { -#define OSTCBStkPtr 0x00 // OSTCBStkPtr -#define OSTCBStkBottom 0x10 // StackAddress -//... -// } VOS_TCB; -#endif /* __ASSEMBLER__ */ - -#endif /* end of arch_balongV7r1.h */ diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/cpu_c.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/cpu_c.h deleted file mode 100644 index 0cc0da93..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/cpu_c.h +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __CPU_C_H__ -#define __CPU_C_H__ - -enum OS_HOOK_TYPE_ENUM -{ - OS_HOOK_TYPE_ENTER_INTR=0, - OS_HOOK_TYPE_EXIT_INTR, - OS_HOOK_TYPE_TASK_SWITCH, - OS_HOOK_TYPE_MSG_GET, - OS_HOOK_TYPE_NMI, - OS_HOOK_TYPE_EXCEPTION, - OS_HOOK_TYPE_APPINIT, - OS_HOOK_TYPE_IDLE, - OS_HOOK_TYPE_BUTT -}; - -enum OS_INTR_CONNECT_TYPE_ENUM -{ - OS_INTR_CONNECT_00=0, /*Int 0 type / priority level NMI / 6 */ - OS_INTR_CONNECT_01, /*Int 1 type / priority level Software / 3 */ - OS_INTR_CONNECT_02, /*Int 2 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_03, /*Int 3 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_04, /*Int 4 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_05, /*Int 5 type / priority level Timer / 3 */ - OS_INTR_CONNECT_06, /*Int 6 type / priority level Timer / 4 */ - OS_INTR_CONNECT_07, /*Int 7 type / priority level ExtLevel / 3 */ - OS_INTR_CONNECT_08, /*Int 8 type / priority level ExtLevel / 3 */ - OS_INTR_CONNECT_09, /*Int 9 type / priority level ExtLevel / 3 */ - OS_INTR_CONNECT_10, /*Int 10 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_11, /*Int 11 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_12, /*Int 12 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_13, /*Int 13 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_14, /*Int 14 type / priority level ExtLevel / 2 */ - OS_INTR_CONNECT_15, /*Int 15 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_16, /*Int 16 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_17, /*Int 17 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_18, /*Int 18 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_19, /*Int 19 type / priority level Timer / 2 */ - OS_INTR_CONNECT_20, /*Int 20 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_21, /*Int 21 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_22, /*Int 22 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_23, /*Int 23 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_24, /*Int 24 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_25, /*Int 25 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_26, /*Int 26 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_27, /*Int 27 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_28, /*Int 28 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_29, /*Int 29 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_30, /*Int 30 type / priority level ExtLevel / 1 */ - OS_INTR_CONNECT_31, /*Int 31 type / priority level ExtEdge / 1 */ - OS_INTR_CONNECT_BUTT -}; - -#define UCOM_SET_WFI_NMI(var1) asm ("waiti 5": :) - -#define UCOM_FlushCache(pAddr, uwSize) \ - xthal_dcache_region_writeback(pAddr, uwSize) - -#define UCOM_FlushCacheAll() \ - xthal_dcache_all_writeback() - -#define UCOM_InvalidateCache(pAddr, uwSize) \ - xthal_dcache_region_invalidate(pAddr, uwSize) - -#define UCOM_InvalidateCacheAll() \ - xthal_dcache_all_invalidate() - -#define ADD_TAG asm("movi a1, 0xdeadbaaf \n movi a2, 0xe8075e80 \n s32i a1, a2, 0": :) - -//typedef void (*HOOK_FUN_TYPE)(void); -typedef void (*HOOK_FUN_TYPE)(unsigned int); - -typedef void (*INTR_HOOK_FUN_TYPE )(unsigned int uwIntNo); - -typedef void (*VOS_EXCEPTION_HOOK_FUNC)( unsigned int uwExceptionNo); - -extern void *g_pfVosHookFuncTable[OS_HOOK_TYPE_BUTT]; - -extern void VOS_ConnectInterrupt(unsigned int uwIntrNo, HOOK_FUN_TYPE pfnInterruptHook); - -extern void VOS_EnableInterrupt(unsigned int uwIntNo); -extern void VOS_DisableInterrupt(unsigned int uwIntNo); - -extern void OS_UserExit(void); - - -#endif /* end of cpu_c.h */ diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_comm.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_comm.h deleted file mode 100644 index 37646777..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_comm.h +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - - -#ifndef __DSP_COMM_H__ -#define __DSP_COMM_H__ - -#include <xtensa/config/core.h> -#include <xtensa/simcall.h> - -#define DSP_FLUSH_PIECE_CACHE(addr, size) xthal_dcache_region_writeback(addr, size) -#define DSP_FLUSH_ALL_CACHE() xthal_dcache_all_writeback() -#define DSP_INVALIDATE_PIECE_CACHE(addr, size) xthal_dcache_region_invalidate(addr, size) -#define DSP_INVALIDATE_ALL_CACHE() xthal_dcache_all_invalidate() - -#define memset(d,uCData,size) dsp_memset(d,uCData,size) -#define memcpy(d,s,size) dsp_memcpy(d,s,size) -#define divsi3(a,b) division(a,b) -#define _divsi3(a,b) division(a,b) - -void dsp_memcpy(void *d, void *s, unsigned int size); -void dsp_memset(void *d, unsigned char ucData, unsigned int size); -int division(int a, int b); - -#endif /* end of dsp_comm.h */ - diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_debug.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_debug.h deleted file mode 100644 index 0ca2d373..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_debug.h +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __DSP_DEBUG_H__ -#define __DSP_DEBUG_H__ - - -#define DEBUG_LEVEL 0 -#define INFO_LEVEL 1 -#define WARNING_LEVEL 1 -#define ERROR_LEVEL 1 -#define TRACE_DUMP 1 - -#define LOG_TAG " DSP_LOG" - -#if TRACE_DUMP -#define DSP_TRACE(fmt, ...) print_log(fmt" @%s:%d \n", ##__VA_ARGS__, __FUNCTION__, __LINE__) -#else -#define DSP_TRACE(fmt, ...) -#endif - -#if DEBUG_LEVEL -#define DSP_LOGD(fmt, ...) print_log(LOG_TAG"[D]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#else -#define DSP_LOGD(fmt, ...) -#endif - -#if INFO_LEVEL -#define DSP_LOGI(fmt, ...) print_log(LOG_TAG"[I]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#else -#define DSP_LOGI(fmt, ...) -#endif - -#if WARNING_LEVEL -#define DSP_LOGW(fmt, ...) print_log(LOG_TAG"[W]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#else -#define DSP_LOGW(fmt, ...) -#endif - -#if ERROR_LEVEL -#define DSP_LOGE(fmt, ...) print_log(LOG_TAG"[E]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#else -+#define DSP_LOGE(fmt, ...) -#endif - - -void print_log(const char *fmt, ...); -void dsp_debug_init(); -#ifdef HIKEY_XAF_IPC_COMMENT_OUT -void dsp_om_func_proc(char *om_str, unsigned int str_len); -#endif -#endif diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_ipc.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_ipc.h deleted file mode 100644 index 2228f32a..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_ipc.h +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __DSP_DRIVER_IPC_H__ -#define __DSP_DRIVER_IPC_H__ - -#if 0 -#define DSP_IPC_FROM_AP_INT_NO (3) -#define DSP_SYS_IPC_BASE_ADDR_NS (0xe896b000) -#define DSP_AP_TO_DSP_MAILBOX_NO (18) -#define DSP_DSP_TO_AP_MAILBOX_NO (2) -#define IPC_BUSY_RETRY_COUNT (1000) -#define IPC_ACPU_INT_SRC_HIFI_MSG (1) -#define BIT_MASK(n) (1 << (n)) - -#define WORD_REF(address) (* ((unsigned int volatile *) (address))) - -#define SYS_IPC_LOCK(base) WORD_REF(base + 0xA00) -#define SYS_IPC_ICLR(base, box) WORD_REF(base + ((box) << 6) + 0x18) -#define SYS_IPC_DATA(base, box, num) WORD_REF(base + ((box) << 6) + 0x20 + ((num) << 2)) -#define SYS_IPC_CPUIRST(base, core) WORD_REF(base + 0x804 + ((core) << 3)) -#define SYS_IPC_MODE(base, box) WORD_REF(base + ((box) << 6) + 0x10) -#define SYS_IPC_SOURCE(base, box) WORD_REF(base + ((box) << 6)) -#define SYS_IPC_DEST(base, box) WORD_REF(base + ((box) * 64) + 0x04) -#define SYS_IPC_SEND(base, box) WORD_REF(base + ((box) << 6) + 0x1c) -#define SYS_IPC_IMASK(base, box) WORD_REF(base + ((box) << 6) + 0x14) -#define SYS_IPC_DCLR(base, box) WORD_REF(base + ((box) * 64) + 0x08) -#define SYS_IPC_CPUIMST(base, core) WORD_REF(base + 0x800 + ((core) * 8)) -#define SYS_IPC_MODE_ACK (7) -#define SYS_IPC_MODE_IDLE (4) -#define SYS_IPC_MODE_AUTOACK (0) - -#define SYS_IPC_CORE_HIFI (4) -#define SYS_IPC_CORE_A15 (0) -#define SYS_IPC_CORE_LPM3 (3) -#endif -#if 0 -extern void dsp_ipc_init(void); -extern void dsp_ipc_wait(void); -#endif -#endif - diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_mailbox.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_mailbox.h deleted file mode 100644 index 5fdcca9a..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_driver_mailbox.h +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __DSP_DRIVER_MAILBOX_H__ -#define __DSP_DRIVER_MAILBOX_H__ - -#include <stdint.h> - -#define HIKEY_MSG_HEAD_PROTECT_WORD 0xffff1234 -#define HIKEY_MSG_BODY_PROTECT_WORD 0xffff4321 - -#define HIKEY_MSG_ID_AP_DSP_OM_CMD 0xDDCB -#define HIKEY_AUDIO_DSP_AP_OM_CMD 0xDDC9 - -typedef enum HIFI_MSG_ID_ { - - /*DTS command id from ap*/ - ID_AP_AUDIO_SET_DTS_ENABLE_CMD = 0xDD36, - ID_AP_AUDIO_SET_DTS_DEV_CMD = 0xDD38, - ID_AP_AUDIO_SET_DTS_GEQ_CMD = 0xDD39, - ID_AP_AUDIO_SET_DTS_GEQ_ENABLE_CMD = 0xDD3B, - - /* APºÍHIFIµÄ¿ØÖÆÍâÖöú»úHIFI codecœ»»¥ÏûÏ¢ */ - ID_AP_AUDIO_SET_EXCODEC_ENABLE_CMD = 0xDD3D, - - /* Voice Record */ - ID_AP_HIFI_VOICE_RECORD_START_CMD = 0xDD40, - ID_AP_HIFI_VOICE_RECORD_STOP_CMD = 0xDD41, - - /* voicePP MSG_ID */ - ID_AP_VOICEPP_START_REQ = 0xDD42, /* Æô¶¯VOICEPPÍš»° */ - ID_VOICEPP_MSG_START = ID_AP_VOICEPP_START_REQ, - ID_VOICEPP_AP_START_CNF = 0xDD43, - ID_AP_VOICEPP_STOP_REQ = 0xDD44, /* ÖÕÖ¹VOICEPPÍš»° */ - ID_VOICEPP_AP_STOP_CNF = 0xDD45, - ID_VOICEPP_MSG_END = 0xDD4A, - - ID_AP_AUDIO_PLAY_START_REQ = 0xDD51,/* APÆô¶¯Hifi audio player requestÃüÁî */ - ID_AUDIO_AP_PLAY_START_CNF = 0xDD52,/* HifiÆô¶¯audio playerºó»ØžŽAP confirmÃüÁî */ - ID_AP_AUDIO_PLAY_PAUSE_REQ = 0xDD53,/* APÍ£Ö¹Hifi audio player requestÃüÁî */ - ID_AUDIO_AP_PLAY_PAUSE_CNF = 0xDD54,/* HifiÍ£Ö¹audio playerºó»ØžŽAP confirmÃüÁî */ - ID_AUDIO_AP_PLAY_DONE_IND = 0xDD56,/* HifiÍšÖªAP audio playerÒ»¿éÊýŸÝ²¥·ÅÍê±Ï»òÕß²¥·ÅÖжÏindication */ - ID_AP_AUDIO_PLAY_UPDATE_BUF_CMD = 0xDD57,/* APÍšÖªHifiÐÂÊýŸÝ¿éžüÐÂcommand */ - ID_AP_AUDIO_PLAY_QUERY_TIME_REQ = 0xDD59,/* AP²éѯHifi audio player²¥·Åœø¶ÈrequestÃüÁî */ - ID_AP_AUDIO_PLAY_WAKEUPTHREAD_REQ = 0xDD5A, - ID_AUDIO_AP_PLAY_QUERY_TIME_CNF = 0xDD60,/* Hifi»ØžŽAP audio player²¥·Åœø¶ÈconfirmÃüÁî */ - ID_AP_AUDIO_PLAY_QUERY_STATUS_REQ = 0xDD61,/* AP²éѯHifi audio player²¥·Å׎̬requestÃüÁî */ - ID_AUDIO_AP_PLAY_QUERY_STATUS_CNF = 0xDD62,/* Hifi»ØžŽAP audio player²¥·Å׎̬confirmÃüÁî */ - ID_AP_AUDIO_PLAY_SEEK_REQ = 0xDD63,/* AP seek Hifi audio playerµœÄ³Ò»Î»ÖÃrequestÃüÁî */ - ID_AUDIO_AP_PLAY_SEEK_CNF = 0xDD64,/* Hifi»ØžŽAP seekœá¹ûconfirmÃüÁî */ - ID_AP_AUDIO_PLAY_SET_VOL_CMD = 0xDD70,/* APÉèÖÃÒôÁ¿ÃüÁî */ - ID_AP_AUDIO_RECORD_PCM_HOOK_CMD = 0xDD7A,/* AP ÍšÖªHIFI¿ªÊŒ×¥È¡PCMÊýŸÝ */ - ID_AUDIO_AP_UPDATE_PCM_BUFF_CMD = 0xDD7C, - ID_AP_AUDIO_DYN_EFFECT_GET_PARAM = 0xDD7D, - ID_AP_AUDIO_DYN_EFFECT_GET_PARAM_CNF = 0xDD7E, - ID_AP_AUDIO_DYN_EFFECT_TRIGGER = 0xDD7F, - /* enhance msgid between ap and hifi */ - ID_AP_HIFI_ENHANCE_START_REQ = 0xDD81, - ID_HIFI_AP_ENHANCE_START_CNF = 0xDD82, - ID_AP_HIFI_ENHANCE_STOP_REQ = 0xDD83, - ID_HIFI_AP_ENHANCE_STOP_CNF = 0xDD84, - ID_AP_HIFI_ENHANCE_SET_DEVICE_REQ = 0xDD85, - ID_HIFI_AP_ENHANCE_SET_DEVICE_CNF = 0xDD86, - - /* audio enhance msgid between ap and hifi */ - ID_AP_AUDIO_ENHANCE_SET_DEVICE_IND = 0xDD91, - ID_AP_AUDIO_MLIB_SET_PARA_IND = 0xDD92, - ID_AP_AUDIO_CMD_SET_SOURCE_CMD = 0xDD95, - ID_AP_AUDIO_CMD_SET_DEVICE_CMD = 0xDD96, - ID_AP_AUDIO_CMD_SET_MODE_CMD = 0xDD97, - ID_AP_AUDIO_CMD_SET_ANGLE_CMD = 0xDD99, - - /* for 3mic */ - ID_AP_AUDIO_ROUTING_COMPLETE_REQ = 0xDDC0,/*AP ÍšÖªHIFI 3Mic/4Mic ͚·ÒÑœšÁ¢*/ - ID_AUDIO_AP_DP_CLK_EN_IND = 0xDDC1,/* HIFI ÍšÖªAºËŽò¿ª»ò¹Ø±ÕCodec DPʱÖÓ */ - ID_AP_AUDIO_DP_CLK_STATE_IND = 0xDDC2,/* AºËÍšÖªHIFI £¬Codec DPʱÖÓ׎̬( Žò¿ª»ò¹Ø±Õ) */ - ID_AUDIO_AP_OM_DUMP_CMD = 0xDDC3,/* HIFI ÍšÖªAºËdumpÈÕÖŸ */ - ID_AUDIO_AP_FADE_OUT_REQ = 0xDDC4,/* HIFIÍšÖªAP×öµ³öŽŠÀí */ - ID_AP_AUDIO_FADE_OUT_IND = 0xDDC5,/* APÍšÖªHIFIµ³öÍê±Ï */ - - ID_AUDIO_AP_OM_CMD = 0xDDC9, - ID_AP_AUDIO_STR_CMD = 0xDDCB,/* APžøHIFI·¢ËÍÒ»žö×Ö·ûŽ®£¬ŸßÌ庬ÒåhifiÖÐœâÎö */ - ID_AUDIO_AP_VOICE_BSD_PARAM_CMD = 0xDDCC,/* VOICE BSD ²ÎÊýÉϱš */ - - ID_AP_ENABLE_MODEM_LOOP_REQ = 0xDDCD,/* the audio hal notify HIFI to start/stop MODEM LOOP*/ - ID_AP_HIFI_REQUEST_VOICE_PARA_REQ = 0xDF00, /*AP REQUEST VOICE MSG*/ - ID_HIFI_AP_REQUEST_VOICE_PARA_CNF = 0xDF01, /*HIFI REPLAY VOICE MSG*/ - - /* XAF message IDs */ - ID_XAF_AP_TO_DSP = 0xDF10, - ID_XAF_DSP_TO_AP = 0xDF11, -} HIFI_MSG_ID; - -#define HIKEY_AP2DSP_MSG_QUEUE_ADDR HIFI_HIKEY_SHARE_MEM_ADDR - -#define HIKEY_AP2DSP_MSG_QUEUE_SIZE 0x1800 -#define HIKEY_DSP2AP_MSG_QUEUE_ADDR (HIKEY_AP2DSP_MSG_QUEUE_ADDR + HIKEY_AP2DSP_MSG_QUEUE_SIZE) -#define HIKEY_DSP2AP_MSG_QUEUE_SIZE 0x1800 - -#define HIKEY_AP_DSP_MSG_MAX_LEN 100 -///////////////////////////////////////////////////////////////////// -// XAF STRUCTURES // -///////////////////////////////////////////////////////////////////// -#ifdef GJB_CHANGE -/* ...command/response message */ -typedef struct xf_proxy_msg { - /* ...session ID */ - uint32_t id; - - /* ...proxy API command/reponse code */ - uint32_t opcode; - - /* ...length of attached buffer */ - uint32_t length; - - /* ...physical address of message buffer */ - uint64_t address; - uint64_t v_address; - -} __attribute__((__packed__)) xf_proxy_msg_t; - -struct hikey_ap_dsp_msg_head { - unsigned int head_protect_word; - unsigned int msg_num; - unsigned int read_pos; - unsigned int write_pos; -}; - -/*struct hikey_ap_dsp_msg_body { - unsigned short msg_id; - unsigned short msg_len; - char msg_content[0]; -};*/ - -struct hikey_ap_dsp_msg_body { - unsigned short msg_id; - unsigned short msg_len; - union { - char msg_content[0]; - struct xf_proxy_msg xf_dsp_msg; - }; -}; -struct hikey_msg_with_content { - struct hikey_ap_dsp_msg_body msg_info; - char msg_content[HIKEY_AP_DSP_MSG_MAX_LEN]; -}; -void dsp_init_share_mem(char *share_mem_addr, unsigned int share_mem_size); -int dsp_mailbox_read(struct hikey_msg_with_content *hikey_msg); -void dsp_msg_process(struct hikey_msg_with_content *hikey_msg); -#else -#endif -#endif diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_memory_config.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_memory_config.h deleted file mode 100644 index fd5a93d3..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_memory_config.h +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __DSP_MEMORY_CONFIG_H__ -#define __DSP_MEMORY_CONFIG_H__ - -/** for chicago only **/ -/**Non Secure 3.5M **/ -/* |0x8B300000|0x8B432000|0x8B532000|0x8B5B1000|0x8B5B2000|0x8B5C5000|0x8B5C6000|0x8B5C7000|0x8B5F9800|~~0x8B609800~~|~~0x8B618800~~|~0x8B618880~|0x8B627880|~0x8B629880~|0x8B62C880~~~| */ -/* |Music data|~~PCM data|~hifi uart|panicstack|icc debug~|flag data~|DDRsechead|~~AP NV ~~|AP&HIFIMB~|codec dma buff|codecdmaconfig|soundtrigger|pcm upload|~hikey share|unsec reserve| */ -/* |~~~~1.2M~~|~~~~1M~~~~|~~508k~~~~|~~~~~4k~~~|~~76k~~~~~|~~~4k~~~~~|~~~4k~~~~~|~~202k~~~~|~~~64k~~~~|~~~~60k~~~~~~~|~~~~128b~~~~~~|~~~~60k~~~~~|~~~8k~~~~~|~~~~~12k~~~~|~~334k-128b~~| */ -/* |0x8B431fff|0x8B531fff|0x8B5B0fff|0x8B5B1fff|0x8B5C4fff|0x8B5C5fff|0x8B5C6fff|0x8B5F97ff|0x8B6097ff|~~0x8B6187FF~~|~~0x8B61887F~~|~0x8B62787F~|0x8B62987F|0x8B62C87F~~|~~0x8B67FFFF~| */ - -/** Secure9.5M **/ -/* |~~~0x89200000~~~|~~~0x89800000~~~|~~~0x89830000~~|~~~0x89864000~~~| */ -/* |~~HIFI RUNNING~~|~OCRAM img bak~~|~~TCM img bak~~|~~~~IMG bak~~~~~| */ -/* |~~~~~~~6M~~~~~~~|~~~~~~192K~~~~~~|~~~~~208k~~~~~~|~~~~~~3.1M ~~~~~| */ -/* |~~~0x897fffff~~~|~~~0x8982ffff~~~|~~~0x89863fff~~|~~~0x89B80000~~~| */ - - -#define HIFI_UNSEC_REGION_SIZE (0x380000) -#define HIFI_MUSIC_DATA_SIZE (0x132000) -#define PCM_PLAY_BUFF_SIZE (0x100000) -#define DRV_DSP_UART_TO_MEM_SIZE (0x7f000) -#define DRV_DSP_UART_TO_MEM_RESERVE_SIZE (0x100) -#define DRV_DSP_STACK_TO_MEM_SIZE (0x1000) -#define HIFI_ICC_DEBUG_SIZE (0x13000) -#define HIFI_FLAG_DATA_SIZE (0x1000) -#define HIFI_SEC_HEAD_SIZE (0x1000) -#define HIFI_AP_NV_DATA_SIZE (0x32800) -#define HIFI_AP_MAILBOX_TOTAL_SIZE (0x10000) -#define CODEC_DSP_OM_DMA_BUFFER_SIZE (0xF000) -#define CODEC_DSP_OM_DMA_CONFIG_SIZE (0x80) -#define CODEC_DSP_SOUNDTRIGGER_TOTAL_SIZE (0xF000) -#define HIFI_PCM_UPLOAD_BUFFER_SIZE (0x2000) -#define HIFI_HIKEY_SHARE_SIZE (0x1800 * 2) -#define HIFI_UNSEC_RESERVE_SIZE (0x53780) - -#define HIFI_UNSEC_BASE_ADDR (0x8B300000) -#define HIFI_MUSIC_DATA_LOCATION (HIFI_UNSEC_BASE_ADDR) -#define PCM_PLAY_BUFF_LOCATION (HIFI_MUSIC_DATA_LOCATION + HIFI_MUSIC_DATA_SIZE) -#define DRV_DSP_UART_TO_MEM (PCM_PLAY_BUFF_LOCATION + PCM_PLAY_BUFF_SIZE) -#define DRV_DSP_STACK_TO_MEM (DRV_DSP_UART_TO_MEM + DRV_DSP_UART_TO_MEM_SIZE) -#define HIFI_ICC_DEBUG_LOCATION (DRV_DSP_STACK_TO_MEM + DRV_DSP_STACK_TO_MEM_SIZE) -#define HIFI_FLAG_DATA_ADDR (HIFI_ICC_DEBUG_LOCATION + HIFI_ICC_DEBUG_SIZE) -#define HIFI_SEC_HEAD_BACKUP (HIFI_FLAG_DATA_ADDR + HIFI_FLAG_DATA_SIZE) -#define HIFI_AP_NV_DATA_ADDR (HIFI_SEC_HEAD_BACKUP + HIFI_SEC_HEAD_SIZE) -#define HIFI_AP_MAILBOX_BASE_ADDR (HIFI_AP_NV_DATA_ADDR + HIFI_AP_NV_DATA_SIZE) -#define CODEC_DSP_OM_DMA_BUFFER_ADDR (HIFI_AP_MAILBOX_BASE_ADDR + HIFI_AP_MAILBOX_TOTAL_SIZE) -#define CODEC_DSP_OM_DMA_CONFIG_ADDR (CODEC_DSP_OM_DMA_BUFFER_ADDR + CODEC_DSP_OM_DMA_BUFFER_SIZE) -#define CODEC_DSP_SOUNDTRIGGER_BASE_ADDR (CODEC_DSP_OM_DMA_CONFIG_ADDR + CODEC_DSP_OM_DMA_CONFIG_SIZE) -#define HIFI_PCM_UPLOAD_BUFFER_ADDR (CODEC_DSP_SOUNDTRIGGER_BASE_ADDR + CODEC_DSP_SOUNDTRIGGER_TOTAL_SIZE) -#define HIFI_HIKEY_SHARE_MEM_ADDR (HIFI_PCM_UPLOAD_BUFFER_ADDR+HIFI_AP_MAILBOX_TOTAL_SIZE) -#define HIFI_UNSEC_RESERVE_ADDR (HIFI_HIKEY_SHARE_MEM_ADDR + HIFI_HIKEY_SHARE_SIZE) - -#define DRV_DSP_PANIC_MARK (HIFI_FLAG_DATA_ADDR) -#define DRV_DSP_UART_LOG_LEVEL (DRV_DSP_PANIC_MARK + 4) -#define DRV_DSP_UART_TO_MEM_CUR_ADDR (DRV_DSP_UART_LOG_LEVEL + 4) - -#define HIFI_SEC_REGION_SIZE (0x980000) -#define HIFI_IMAGE_OCRAMBAK_SIZE (0x30000) -#define HIFI_RUN_SIZE (0x600000) -#define HIFI_IMAGE_TCMBAK_SIZE (0x34000) -#define HIFI_IMAGE_SIZE (0x31C000) -#define HIFI_RUN_ITCM_BASE (0xe8080000) -#define HIFI_RUN_ITCM_SIZE (0x9000) -#define HIFI_RUN_DTCM_BASE (0xe8058000) -#define HIFI_RUN_DTCM_SIZE (0x28000) - - -#define HIFI_SEC_REGION_ADDR (0x89200000) /* chciago */ -#define HIFI_RUN_LOCATION (HIFI_SEC_REGION_ADDR) -#define HIFI_IMAGE_OCRAMBAK_LOCATION (HIFI_RUN_LOCATION + HIFI_RUN_SIZE) -#define HIFI_IMAGE_TCMBAK_LOCATION (HIFI_IMAGE_OCRAMBAK_LOCATION + HIFI_IMAGE_OCRAMBAK_SIZE) -#define HIFI_IMAGE_LOCATION (HIFI_IMAGE_TCMBAK_LOCATION + HIFI_IMAGE_TCMBAK_SIZE) - -#endif diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_pcm_gain.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_pcm_gain.h deleted file mode 100644 index 24f94ec1..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/dsp_pcm_gain.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef DSP_PCM_GAIN_H -#define __DSP_PCM_GAIN_H__ -#include "dsp_memory_config.h" -#define FRAME_SIZE 480 // 10 ms @ 48 KHz. -#define HOLD_BUF_SIZE 228404 -#define MSG_RECV 1 // Msg received -#define MSG_PROC 2 // Msg processed. -#define MSG_COMP 8 -#define MSG_INCOMP 9 -#define MUSIC_DATA_MEM_READ_ADDR HIFI_MUSIC_DATA_LOCATION // Address of the Music data memory.. !!! change this if necessary.. -#define PCM_DATA_MEM_WRITE_ADDR PCM_PLAY_BUFF_LOCATION // Address of some random element in PCM data memory.. !!! change this if necessary.. -int ReadData( char *pDst, int Size ); -int WriteData( char *pSrc, int Size ); -int processAudio( int *pDst, int *pSrc, int Size ); -#endif diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/reset.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/reset.h deleted file mode 100644 index 5a77a97d..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/reset.h +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - - -#include <xtensa/coreasm.h> -#include <xtensa/simcall.h> -#define PIF_CACHED 1 -#define PIF_BYPASS 2 -#define PIF_CACHED_WBA 4 -#define PIF_CACHED_WBNA 5 -#define PIF_INVALID 15 - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif - - - -/*set memory mapping attribute*/ -.macro set_access_mode am - rdtlb1 a4, a3 - ritlb1 a5, a3 - srli a4, a4, 4 - slli a4, a4, 4 - srli a5, a5, 4 - slli a5, a5, 4 - addi a4, a4, \am - addi a5, a5, \am - wdtlb a4, a3 - witlb a5, a3 -.endm - - - - -#ifdef __cplusplus - #if __cplusplus - } - #endif -#endif - diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/xf-board.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/xf-board.h deleted file mode 100644 index e42ab1b9..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/board-hikey/xf-board.h +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * board-hikey/xf-board.h - * - * HiKey960-specific definitions - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-board.h mustn't be included directly" -#endif - -/******************************************************************************* - * Global constants definitions - ******************************************************************************/ - -/* ...shared memory interface address */ -#define XF_CFG_SHMEM_ADDRESS(core) HIFI_HIKEY_SHARE_MEM_ADDR - -/* ...tracing buffer configuration (place at the end of memory) */ -#define XF_CFG_TRACE_START(core) 0x78000000 -#define XF_CFG_TRACE_END(core) 0x7FFFFFFF -#if 1 -#define DSP_IPC_FROM_AP_INT_NO (3) -#define DSP_SYS_IPC_BASE_ADDR_NS (0xe896b000) -#define DSP_AP_TO_DSP_MAILBOX_NO (18) -#define DSP_DSP_TO_AP_MAILBOX_NO (2) -#define IPC_BUSY_RETRY_COUNT (1000) -#define IPC_ACPU_INT_SRC_HIFI_MSG (1) -#define BIT_MASK(n) (1 << (n)) - -#define WORD_REF(address) (* ((unsigned int volatile *) (address))) - -#define SYS_IPC_LOCK(base) WORD_REF(base + 0xA00) -#define SYS_IPC_ICLR(base, box) WORD_REF(base + ((box) << 6) + 0x18) -#define SYS_IPC_DATA(base, box, num) WORD_REF(base + ((box) << 6) + 0x20 + ((num) << 2)) -#define SYS_IPC_CPUIRST(base, core) WORD_REF(base + 0x804 + ((core) << 3)) -#define SYS_IPC_MODE(base, box) WORD_REF(base + ((box) << 6) + 0x10) -#define SYS_IPC_SOURCE(base, box) WORD_REF(base + ((box) << 6)) -#define SYS_IPC_DEST(base, box) WORD_REF(base + ((box) * 64) + 0x04) -#define SYS_IPC_SEND(base, box) WORD_REF(base + ((box) << 6) + 0x1c) -#define SYS_IPC_IMASK(base, box) WORD_REF(base + ((box) << 6) + 0x14) -#define SYS_IPC_DCLR(base, box) WORD_REF(base + ((box) * 64) + 0x08) -#define SYS_IPC_CPUIMST(base, core) WORD_REF(base + 0x800 + ((core) * 8)) -#define SYS_IPC_MODE_ACK (7) -#define SYS_IPC_MODE_IDLE (4) -#define SYS_IPC_MODE_AUTOACK (0) - -#define SYS_IPC_CORE_HIFI (4) -#define SYS_IPC_CORE_A15 (0) -#define SYS_IPC_CORE_LPM3 (3) -#endif -/* ...inter-processor interrupt number (SEL:10 - LEVEL:15) */ -#define XF_PROXY_IPI_NUM(core) 15 - -/******************************************************************************* - * External functions - ******************************************************************************/ - -/* ...gdb stub initialization */ -extern void init_gdbstub(void); - -/* ...emit breakpoint */ -extern void breakpoint(void); -#if 0// def HIKEY_XAF_IPC_COMMENT_OUT -/******************************************************************************* - * Public proxy API - ******************************************************************************/ - -/* ...notify remote side about status change */ -#define XF_PROXY_NOTIFY_PEER(core) h2_wake_core() - -/* ...clear pending interrupt mask */ -#define XF_PROXY_SYNC_PEER(core) h2_local_ack() - -/******************************************************************************* - * Auxiliary helper functions - ******************************************************************************/ - -/* ...generate inter-processor interrupt for remote core */ -static inline void h2_wake_core(void) -{ - /* ...we have single INPUT-interrupt pin */ - *(volatile unsigned int *)0xec800044 = 1; -} - -/* ...acknowledge pending IPI interrupt */ -static inline void h2_local_ack(void) -{ - /* ...asserted interrupt cannot be cleared */ -} - -/******************************************************************************* - * Board specific init - ******************************************************************************/ - -static inline void xf_board_init(void) -{ - /* ...initialize GDB debugging interface */ - init_gdbstub(); - - /* ...indicate the board has started */ - *(volatile unsigned int *)0xec800100 = 1; -} -#else -//#define XF_PROXY_NOTIFY_PEER(core) dsp_ipc_send_irq_to_ap() -#define XF_PROXY_NOTIFY_PEER(core) h2_wake_core() -/* ...clear pending interrupt mask */ -#define XF_PROXY_SYNC_PEER(core) h2_local_ack() - -/* ...generate inter-processor interrupt for remote core */ -static inline void h2_wake_core(void) -{ - unsigned int mode = 0; - unsigned int mode_1 = 0; - - // mode = SYS_IPC_MODE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO); - //mode = (* ((unsigned int volatile *) (0xe896b000 + ((2) << 6) + 0x10))); - mode = * (volatile unsigned int*) 0xe896b090; - - //if (mode & BIT_MASK(SYS_IPC_MODE_IDLE)) { - //if (mode & (1 << (4))) { - if (mode & 0x10) { - mode_1=0; - } else { - return; - } - - //SYS_IPC_SOURCE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_CORE_HIFI); - //(* ((unsigned int volatile *) (0xe896b000 + ((2) << 6))))= (1 << (4)); - * (volatile unsigned int *) 0xe896b080 = (0x10); - - //SYS_IPC_IMASK(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = ~((unsigned int)(BIT_MASK(SYS_IPC_CORE_HIFI)|BIT_MASK(SYS_IPC_CORE_A15))); - //(* ((unsigned int volatile *) (0xe896b000 + ((2) << 6) + 0x14))) = ~ ((unsigned int)((1 << (4))|(1 << (0)))); - * (volatile unsigned int *)0xe896b094 = ~ ((unsigned int)(0x11)); - - //SYS_IPC_DATA(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO, 0) = IPC_ACPU_INT_SRC_HIFI_MSG; - //(* ((unsigned int volatile *) (0xe896b000 + ((2) << 6) + 0x20 + ((0) << 2)))) = 1; - * (volatile unsigned int *) 0xe896b0A0 = 1; - - //SYS_IPC_MODE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_MODE_AUTOACK); - //(* ((unsigned int volatile *) (0xe896b000 + ((2) << 6) + 0x10))) = (1 << (0)); - * (volatile unsigned int *) 0xe896b090 = 1; - - //SYS_IPC_SEND(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_CORE_HIFI); - //(* ((unsigned int volatile *) (0xe896b000 + ((2) << 6) + 0x1c))) = (1 << (4)); - * (volatile unsigned int *) 0xe896b09C = 0x10; - - return; -} - -/* ...acknowledge pending IPI interrupt */ -static inline void h2_local_ack(void) -{ - /* ...asserted interrupt cannot be cleared */ -} - -#endif - diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-config.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-config.h deleted file mode 100644 index 4775e807..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-config.h +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-config.h - * - * Xtensa target configuration parameters - * - *******************************************************************************/ - -/* ...number of DSP cores */ -#define XF_CFG_CORES_NUM 1 - -/* ...size of the internal message pool (make it equal to at least ring-buffer) */ -#define XF_CFG_MESSAGE_POOL_SIZE 256 - -/* ...local IPC is coherent (say) */ -#define XF_LOCAL_IPC_NON_COHERENT 0 - -/* ...remote IPC is non coherent (say) */ -#define XF_REMOTE_IPC_NON_COHERENT 1 - -/* ...size of the local memory pool (in bytes) */ -#define XF_CFG_LOCAL_POOL_SIZE (1024 << 10) - -/* ...size of the shared memory pool (in bytes) */ -#if 1//def XAF_ENABLE_NON_HIKEY -#define XF_CFG_REMOTE_IPC_POOL_SIZE (256 << 10) -#else -#define XF_CFG_REMOTE_IPC_POOL_SIZE (HIFI_MUSIC_DATA_SIZE) -#endif - -/* ...size of the local memory pool (in bytes) */ -#define XF_CFG_LOCAL_IPC_POOL_SIZE (1024 << 10) -#ifdef XAF_ENABLE_NON_HIKEY -/* ...maximal size of scratch memory is 80 KB */ -#define XF_CFG_CODEC_SCRATCHMEM_SIZE (80 << 10) -#else -/* ...maximal size of scratch memory is 56 KB */ -#define XF_CFG_CODEC_SCRATCHMEM_SIZE (56 << 10) -#endif - -/* ...scratch memory is 8-bytes aligned */ -#define XF_CFG_CODEC_SCRATCHMEM_ALIGN 8 diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-hal.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-hal.h deleted file mode 100644 index 82cf3c11..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-hal.h +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-hal.h - * - * Platform-specific HAL definitions - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-hal.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...primitive types */ -#include "xf-types.h" - -/* ...XTOS runtime */ -#include <xtensa/xtruntime.h> - -/******************************************************************************* - * Auxilliary macros definitions - ******************************************************************************/ - -/* ...use system-specific cache-line size */ -#define XF_PROXY_ALIGNMENT XCHAL_DCACHE_LINESIZE - -/* ...properly aligned shared memory structure */ -#define __xf_shmem__ __attribute__((__aligned__(XF_PROXY_ALIGNMENT))) - -/******************************************************************************* - * Interrupt control - ******************************************************************************/ - -/* ...disable interrupts on given core */ -static inline u32 xf_isr_disable(u32 core) -{ - /* ...no actual dependency on the core identifier */ - return XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); -} - -/* ...enable interrupts on given core */ -static inline void xf_isr_restore(u32 core, u32 status) -{ - /* ...no actual dependency on the core identifier */ - XTOS_RESTORE_INTLEVEL(status); -} - -/******************************************************************************* - * Auxiliary system-specific functions - ******************************************************************************/ - -#if XF_CFG_CORES_NUM > 1 -/* ...current core identifier (from HW) */ -static inline u32 xf_core_id(void) -{ - /* ...retrieve core identifier from HAL */ - return (u32) xthal_get_prid(); -} -#else -#define xf_core_id() 0 -#endif - -/******************************************************************************* - * Atomic operations (atomicity is assured on local core only) - ******************************************************************************/ - -static inline int xf_atomic_test_and_set(volatile u32 *bitmap, u32 mask) -{ - u32 status; - u32 v; - - /* ...atomicity is assured by interrupts masking */ - status = XTOS_DISABLE_ALL_INTERRUPTS; - v = *bitmap, *bitmap = v | mask; - XTOS_RESTORE_INTLEVEL(status); - - return !(v & mask); -} - -static inline int xf_atomic_test_and_clear(volatile u32 *bitmap, u32 mask) -{ - u32 status; - u32 v; - - /* ...atomicity is assured by interrupts masking */ - status = XTOS_DISABLE_ALL_INTERRUPTS; - v = *bitmap, *bitmap = v & ~mask; - XTOS_RESTORE_INTLEVEL(status); - - return (v & mask); -} - -static inline u32 xf_atomic_set(volatile u32 *bitmap, u32 mask) -{ - u32 status; - u32 v; - - /* ...atomicity is assured by interrupts masking */ - status = XTOS_DISABLE_ALL_INTERRUPTS; - v = *bitmap, *bitmap = (v |= mask); - XTOS_RESTORE_INTLEVEL(status); - - return v; -} - -static inline u32 xf_atomic_clear(volatile u32 *bitmap, u32 mask) -{ - u32 status; - u32 v; - - /* ...atomicity is assured by interrupts masking */ - status = XTOS_DISABLE_ALL_INTERRUPTS; - v = *bitmap, *bitmap = (v &= ~mask); - XTOS_RESTORE_INTLEVEL(status); - - return v; -} - -/******************************************************************************* - * Abortion macro (debugger should be configured) - ******************************************************************************/ - -/* ...breakpoint function */ -extern void breakpoint(void); - -/* ...abort execution (enter into debugger) */ -#define __xf_abort() breakpoint() diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-ipc.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-ipc.h deleted file mode 100644 index 3ce5bd66..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-ipc.h +++ /dev/null @@ -1,345 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-ipc.h - * - * Xtensa IPC mechanism - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-ipc.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...system-specific shared memory configuration */ -#include "xf-shmem.h" -#ifndef XAF_ENABLE_NON_HIKEY -#include <xtensa/xtruntime.h> -extern volatile int waitstate; -#endif - -#ifdef XAF_ENABLE_NON_HIKEY -/******************************************************************************* - * Macros definitions (should better go to some other header) - ******************************************************************************/ - -/* - * Execute WAITI 0 (enabling interrupts) only if *(ptr) is zero. - * The decision to execute WAITI is done atomically by disabling - * interrupts at level 'level' (level must be a constant) - * before checking the pointer. Interrupts are always re-enabled - * on exit from this macro. - */ -#define _WAITI_ON_PTR(ptr, level) \ -do { \ - int __tmp; \ - __asm__ (" rsil %0, " #level " \n" \ - " l32i %0, %1, 0 \n" \ - " bnez %0, 1f \n" \ - " waiti 0 \n" \ - "1:rsil %0, 0 \n" \ - : "=a" (__tmp) : "a" (ptr) : "memory"); \ -} while(0) - -/* ...enable gdbstub */ -//#define XF_CFG_USE_GDBSTUB 0 - -#ifndef XF_CFG_USE_GDBSTUB -/* ...maybe "level" should be hidden here - we always magically set 15 */ -#define WAITI_ON_PTR(ptr, level) _WAITI_ON_PTR(ptr, level) -#else -/* ...if debugger is enabled, do polling instead of waiting */ -static inline void WAITI_ON_PTR(volatile u32 *ptr, u32 level) -{ - extern void poll_debug_ring(void); - - while (*ptr == 0) - { - /* ...should be called with interrupts disabled - tbd */ - poll_debug_ring(); - } -} -#endif - -/******************************************************************************* - * Remote IPI interrupt mode - ******************************************************************************/ - -/* ...enable/disable IPI interrupt */ -static inline void xf_ipi_enable(u32 core, int on) -{ - if (on) - _xtos_ints_on(1 << XF_PROXY_IPI_NUM(core)); - else - _xtos_ints_off(1 << XF_PROXY_IPI_NUM(core)); -} - -/* ...wait in low-power mode for interrupt arrival if "ptr" is 0 */ -static inline void xf_ipi_wait(u32 core) -{ - xf_core_ro_data_t *ro = XF_CORE_RO_DATA(core); - - /* ...enable IPI interrupt before sleeping */ - xf_ipi_enable(core, 1); - - /* ...wait in low-power mode, atomically checking *ipc != 0 */ - WAITI_ON_PTR(&ro->ipc.wait, 15); - - /* ...force disabling of IPI interrupts */ - xf_ipi_enable(core, 0); - - /* ...reset waiting object upon leaving */ - ro->ipc.wait = 0; -} -#else -#define _WAITI_ON_PTR(ptr, level) \ - do { \ - int __tmp; \ - __asm__ (" rsil %0, " #level " \n" \ - " l32i %0, %1, 0 \n" \ - " bnez %0, 1f \n" \ - " waiti 0 \n" \ - "1:rsil %0, 0 \n" \ - : "=a" (__tmp) : "a" (ptr) : "memory"); \ - } while(0) - -#define WAITI_ON_PTR(ptr, level) _WAITI_ON_PTR(ptr, level) -static inline void xf_ipi_wait(u32 core) -{ -#if 0 - // VOS_EnableInterrupt(DSP_IPC_FROM_AP_INT_NO); - _xtos_ints_on(1 << DSP_IPC_FROM_AP_INT_NO); - while(1) - { - if(waitstate ==1) - { - // VOS_DisableInterrupt(DSP_IPC_FROM_AP_INT_NO); - _xtos_ints_off(1 << DSP_IPC_FROM_AP_INT_NO); - waitstate = 0; - break; - } - } -#else - - _xtos_ints_on(1 << DSP_IPC_FROM_AP_INT_NO); - /* ...wait in low-power mode, atomically checking *ipc != 0 */ - WAITI_ON_PTR(&waitstate, 15); - - /* ...force disabling of IPI interrupts */ - - _xtos_ints_off(1 << DSP_IPC_FROM_AP_INT_NO); - /* ...reset waiting object upon leaving */ - waitstate = 0; - -#endif -} -#endif -#ifdef XAF_ENABLE_NON_HIKEY -/* ...complete IPI waiting (may be called from any context on local core) */ -static inline void xf_ipi_resume(u32 core) -{ - xf_core_ro_data_t *ro = XF_CORE_RO_DATA(core); - - /* ...single instruction is written atomically; no need to mask interrupts */ - ro->ipc.wait = 1; -} -#else -/* ...complete IPI waiting (may be called from any context on local core) */ -static inline void xf_ipi_resume(u32 core) -{ - unsigned int ipc_int_state = 0; - unsigned int ipc_data = 0; - - _xtos_ints_off(1 << DSP_IPC_FROM_AP_INT_NO); - - //process message - ipc_int_state = SYS_IPC_CPUIRST(DSP_SYS_IPC_BASE_ADDR_NS, SYS_IPC_CORE_HIFI); - - if (ipc_int_state & BIT_MASK(DSP_AP_TO_DSP_MAILBOX_NO)) { //mailbox-18 - SYS_IPC_ICLR(DSP_SYS_IPC_BASE_ADDR_NS, DSP_AP_TO_DSP_MAILBOX_NO) = BIT_MASK(SYS_IPC_CORE_HIFI); - waitstate = 1; - } - - //_xtos_ints_on(1 << DSP_IPC_FROM_AP_INT_NO); - - return; -} -#endif -#if 0//ndef HIKEY_XAF_IPC_COMMENT_OUT -/* ...notify remote side about status change */ -//#define XF_PROXY_NOTIFY_PEER(core) dsp_ipc_send_irq_to_ap() - -static inline void dsp_ipc_send_irq_to_ap(void) -{ - unsigned int mode = 0; - unsigned int mode_1 = 0; - - mode = SYS_IPC_MODE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO); - - if (mode & BIT_MASK(SYS_IPC_MODE_IDLE)) { - mode_1=0; - } else { - return; - } - - - SYS_IPC_SOURCE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_CORE_HIFI); - SYS_IPC_IMASK(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = ~((unsigned int)(BIT_MASK(SYS_IPC_CORE_HIFI)|BIT_MASK(SYS_IPC_CORE_A15))); - SYS_IPC_DATA(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO, 0) = IPC_ACPU_INT_SRC_HIFI_MSG; - SYS_IPC_MODE(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_MODE_AUTOACK); - SYS_IPC_SEND(DSP_SYS_IPC_BASE_ADDR_NS, DSP_DSP_TO_AP_MAILBOX_NO) = BIT_MASK(SYS_IPC_CORE_HIFI); - - return; -} -#endif -/* ...assert IPI interrupt on remote core - board-specific */ -static inline void xf_ipi_assert(u32 core) -{ - XF_PROXY_NOTIFY_PEER(core); -} - -#ifdef XAF_ENABLE_NON_HIKEY -/* ...initialize IPI subsystem */ -static inline int xf_ipi_init(u32 core) -{ - xf_core_ro_data_t *ro = XF_CORE_RO_DATA(core); - extern void (* const xf_ipi_handlers[])(void); - - /* ...reset IPC data - no interrupt yet */ - ro->ipc.wait = 0; - - /* ...install interrupt handler */ - _xtos_set_interrupt_handler(XF_PROXY_IPI_NUM(core), xf_ipi_handlers[core]); - - return 0; -} -#else -/* ...initialize IPI subsystem */ -static inline int xf_ipi_init(u32 core) -{ - - waitstate =0; - - dsp_debug_init(); - //dsp_init_share_mem(HIKEY_AP2DSP_MSG_QUEUE_ADDR,HIKEY_DSP2AP_MSG_QUEUE_SIZE); - /* unlock reg */ - SYS_IPC_LOCK(DSP_SYS_IPC_BASE_ADDR_NS) = 0x1ACCE551; - //VOS_ConnectInterrupt(DSP_IPC_FROM_AP_INT_NO, _ap_to_dsp_ipc_irq_proc); - VOS_ConnectInterrupt(DSP_IPC_FROM_AP_INT_NO, xf_ipi_resume); - -// VOS_EnableInterrupt(DSP_IPC_FROM_AP_INT_NO); - - return; -} -#endif - -/******************************************************************************* - * Shared memory operations - ******************************************************************************/ - -/* ...NULL-address specification */ -#define XF_PROXY_NULL (~0U) - -/* ...invalid proxy address */ -#define XF_PROXY_BADADDR XF_CFG_REMOTE_IPC_POOL_SIZE -/* ...translate buffer address to shared proxy address */ -static inline u32 xf_ipc_b2a(u32 core, void *b) -{ - xf_shmem_data_t *shmem = XF_CORE_DATA(core)->shmem; - void *start = shmem->buffer; - - if (b == NULL) - return XF_PROXY_NULL; - else if ((s32)(b - start) < XF_CFG_REMOTE_IPC_POOL_SIZE) - return (u32)(b - start); - else - return XF_PROXY_BADADDR; -} -/* ...translate shared proxy address to local pointer */ -static inline void * xf_ipc_a2b(u32 core, u32 address) -{ - xf_shmem_data_t *shmem = XF_CORE_DATA(core)->shmem; - void *start = shmem->buffer; - - if (address < XF_CFG_REMOTE_IPC_POOL_SIZE) - return start + address; - else if (address == XF_PROXY_NULL) - return NULL; - else - return (void *)-1; -} - -/* ...component association with remote IPC client */ -static inline void xf_ipc_component_addref(u32 session) -{ -} - -/* ...delete record about component association with remote IPC client */ -static inline void xf_ipc_component_rmref(u32 id) -{ -} - -/* ...system-specific IPC layer initialization */ -extern int xf_ipc_init(u32 core); - -/******************************************************************************* - * Mutex definitions - ******************************************************************************/ - -/* ...export shared memory access macros */ -#define MUTEX_SHARED_READ(core) \ - ({ xf_core_ro_data_t *__ro = XF_CORE_RO_DATA(core); __ro->lock[0]; }) - -#define MUTEX_SHARED_WRITE(core, val) \ - ({ xf_core_ro_data_t *__ro = XF_CORE_RO_DATA(core); __ro->lock[0] = (val); }) - -/* ...include library header */ -#include "lib/mutex.h" - -#if XF_CFG_CORES_NUM > 1 -/* ...rename API functions */ -static inline void xf_mutex_lock(u32 core) -{ - mutex_lock(core); -} - -static inline void xf_mutex_unlock(u32 core) -{ - mutex_unlock(core); -} - -#else -/* ...for single-core setting no locking is actually needed */ -static inline void xf_mutex_lock(u32 core) -{ -} - -static inline void xf_mutex_unlock(u32 core) -{ -} - -#endif /* XF_CFG_CORES_NUM > 1 */ diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-mem.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-mem.h deleted file mode 100644 index dc277871..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-mem.h +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-mem.h - * - * System-specific memory allocator - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-mem.h mustn't be included directly" -#endif - -/******************************************************************************* - * System specific memory pools - ******************************************************************************/ - -#if XF_CFG_CORES_NUM > 1 -/* ...shared memory pool for communication within DSP-cluster */ -extern xf_mm_pool_t xf_dsp_shmem_pool; -#endif - -/******************************************************************************* - * Platform-specific SHMEM allocation registering functions - ******************************************************************************/ - -/* ...register shmem allocation address */ -static inline void xf_shmem_alloc_addref(u32 core, xf_message_t *m) -{ -} - -/* ...unregister shmem allocation address */ -static inline void xf_shmem_alloc_rmref(u32 core, xf_message_t *m) -{ -} - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...allocate aligned memory on particular core specifying if it is shared */ -static inline void * xf_mem_alloc(u32 size, u32 align, u32 core, u32 shared) -{ -#if XF_CFG_CORES_NUM > 1 - if (shared) - { - /* ...if memory is shared, core is dropped */ - return xf_mm_alloc(&xf_dsp_shmem_pool, size); - } -#endif - - /* ...select local memory pool basing on core specification */ - return xf_mm_alloc(&XF_CORE_DATA(core)->local_pool, size); -} -#ifdef XAF_ENABLE_NON_HIKEY -/* ...redefine macro to add bugchecks */ -#define xf_mem_alloc(size, align, core, shared) \ -({ \ - void *__data; \ - /* ...size must be properly aligned */ \ - BUG(!XF_MM_ALIGNED(size), _x("Bad size: %u"), size); \ - __data = (xf_mem_alloc)(size, align, core, shared); \ - TRACE(1, _b("alloc-%u: %p[%u] (shared=%u)"), core, __data, size, shared); \ - __data; \ -}) -#endif -/* ...release allocated memory */ -static inline void xf_mem_free(void *p, u32 size, u32 core, u32 shared) -{ -#if XF_CFG_CORES_NUM > 1 - if (shared) - { - /* ...if memory is shared, core is dropped */ - xf_mm_free(&xf_dsp_shmem_pool, p, size); - return; - } -#endif - - /* ...select proper pool basing on core specification */ - xf_mm_free(&XF_CORE_DATA(core)->local_pool, p, size); -} -#ifdef XAF_ENABLE_NON_HIKEY -/* ...redefine macro to add bugchecks */ -#define xf_mem_free(p, size, core, shared) \ -({ \ - void *__data = (p); \ - /* ...size must be properly aligned */ \ - BUG(!XF_MM_ALIGNED(size), _x("Bad size: %u"), size); \ - TRACE(1, _b("free-%u: %p[%u] (shared=%u)"), core, __data, size, shared); \ - (xf_mem_free)(__data, size, core, shared); \ -}) -#endif -/* ...allocate AP-DSP shared memory */ -static inline int xf_shmem_alloc(u32 core, xf_message_t *m) -{ - xf_mm_pool_t *pool = &XF_CORE_DATA(core)->shared_pool; - - /* ...length is always cache-line aligned */ - if ((m->buffer = xf_mm_alloc(pool, XF_ALIGNED(m->length))) != NULL) - { - /* ...register allocation address */ - xf_shmem_alloc_addref(core, m); - - return 0; - } - else - { - return -ENOMEM; - } -} - -/* ...free AP-DSP shared memory */ -static inline void xf_shmem_free(u32 core, xf_message_t *m) -{ - xf_mm_pool_t *pool = &XF_CORE_DATA(core)->shared_pool; - - /* ...length is always cache-line aligned */ - xf_mm_free(pool, m->buffer, XF_ALIGNED(m->length)); - - /* ...unregister allocation address */ - xf_shmem_alloc_rmref(core, m); -} - -/******************************************************************************* - * Scratch memory management - ******************************************************************************/ - -static inline void * xf_scratch_mem_init(u32 core) -{ - /* ...allocate scratch memory from local DSP memory */ - return xf_mem_alloc(XF_CFG_CODEC_SCRATCHMEM_SIZE, XF_CFG_CODEC_SCRATCHMEM_ALIGN, core, 0); -} - -/******************************************************************************* - * Helpers - hmm; they are platform-independent - tbd - ******************************************************************************/ - -/* ...allocate local buffer */ -static inline int xf_mm_alloc_buffer(u32 size, u32 align, u32 core, xf_mm_buffer_t *b) -{ - /* ...allocate memory from proper local pool */ - if ((size = XF_MM(size)) != 0) - XF_CHK_ERR(b->addr = xf_mem_alloc(size, align, core, 0), -ENOMEM); - else - b->addr = NULL; - - /* ...save address */ - b->size = size; - - return 0; -} - -/* ...free local buffer */ -static inline void xf_mm_free_buffer(xf_mm_buffer_t *b, u32 core) -{ - if (b->addr) - { - xf_mem_free(b->addr, b->size, core, 0); - } -} diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-runtime.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-runtime.h deleted file mode 100644 index ab328ccf..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-runtime.h +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-runtime.h - * - * Platform-specific runtime data definitions - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-runtime.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...platform HAL layer */ -#include "xf-hal.h" - -/******************************************************************************* - * Mutex (opaque) data definition - ******************************************************************************/ - -typedef volatile u32 xf_mutex_t[XF_CFG_CORES_NUM > 1 ? 1 : 0]; - -/******************************************************************************* - * Local/remote/ISR IPC (opaque) data - ******************************************************************************/ - -typedef struct xf_ipc_handle -{ - /* ...variable we are waiting on */ - u32 wait; - -} xf_ipc_handle_t; - -/******************************************************************************* - * IPC events - ******************************************************************************/ - -/* ...core resumption flag */ -#define XF_IPC_EVENT_CORE_ASSERT (1 << 0) - -/* ...core waiting flag */ -#define XF_IPC_EVENT_CORE_WAIT (1 << 1) - -/* ...shared memory assertion flag */ -#define XF_IPC_EVENT_SHMEM_ASSERT (1 << 2) - -/* ...shared memory waiting flag */ -#define XF_IPC_EVENT_SHMEM_WAIT (1 << 3) - -/* ...disabled interrupts status */ -#define XF_IPC_EVENT_ISR_OFF (1 << 4) - -/******************************************************************************* - * Shared memory interface (opaque) data - ******************************************************************************/ - -typedef void * xf_shmem_handle_t; diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-shmem.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-shmem.h deleted file mode 100644 index 813bfb48..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-shmem.h +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-shmem.h - * - * Definitions for Xtensa SHMEM configuration - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-shmem.h mustn't be included directly" -#endif - -/******************************************************************************* - * Memory structures - ******************************************************************************/ - -/* ...data managed by host CPU (remote) - in case of shunt it is a IPC layer */ -struct xf_proxy_host_data -{ - /* ...command queue */ - xf_proxy_message_t command[XF_PROXY_MESSAGE_QUEUE_LENGTH]; - - /* ...writing index into command queue */ - u32 cmd_write_idx; - - /* ...reading index for response queue */ - u32 rsp_read_idx; -#ifdef XAF_ENABLE_NON_HIKEY -} __attribute__((__packed__, __aligned__(XF_PROXY_ALIGNMENT))); -#else -}/* __attribute__((__packed__, __aligned__(XF_PROXY_ALIGNMENT)))*/; -#endif - -/* ...data managed by DSP (local) */ -struct xf_proxy_dsp_data -{ - /* ...response queue */ - xf_proxy_message_t response[XF_PROXY_MESSAGE_QUEUE_LENGTH]; - - /* ...writing index into response queue */ - u32 rsp_write_idx; - - /* ...reading index for command queue */ - u32 cmd_read_idx; -#ifdef XAF_ENABLE_NON_HIKEY -} __attribute__((__packed__, __aligned__(XF_PROXY_ALIGNMENT))); -#else -}/* __attribute__((__packed__, __aligned__(XF_PROXY_ALIGNMENT)))*/; -#endif -/* ...shared memory data */ -typedef struct xf_shmem_data -{ - /* ...outgoing data (maintained by host CPU (remote side)) */ -#ifdef XAF_ENABLE_NON_HIKEY - struct xf_proxy_host_data remote __xf_shmem__; - - /* ...ingoing data (maintained by DSP (local side)) */ - struct xf_proxy_dsp_data local __xf_shmem__; - - /* ...shared memory pool (page-aligned; why? we map memory to user-space) */ - u8 buffer[XF_CFG_REMOTE_IPC_POOL_SIZE] __attribute__((__aligned__(4096))); -#else - /* ...outgoing data (maintained by host CPU (remote side)) */ - struct xf_proxy_host_data remote/* __xf_shmem__*/; - - /* ...ingoing data (maintained by DSP (local side)) */ - struct xf_proxy_dsp_data local/* __xf_shmem__*/; - - /* ...shared memory pool (page-aligned; why? we map memory to user-space) */ - uint8_t* buffer; -#endif - -} xf_shmem_data_t; - -/******************************************************************************* - * Shared memory accessors - ******************************************************************************/ - -/* ...shared memory pointer for a core */ -#define XF_SHMEM_DATA(core) \ - ((xf_shmem_data_t *)XF_CORE_DATA(core)->shmem) - -/* ...atomic reading */ -#define XF_PROXY_READ_ATOMIC(var) \ - ({ XF_PROXY_INVALIDATE(&(var), sizeof(var)); (var); }) - -/* ...atomic writing */ -#define XF_PROXY_WRITE_ATOMIC(var, value) \ - ({(var) = (value); XF_PROXY_FLUSH(&(var), sizeof(var)); (value); }) - -/* ...accessors */ -#define XF_PROXY_READ(core, field) \ - __XF_PROXY_READ_##field(XF_SHMEM_DATA(core)) - -#define XF_PROXY_WRITE(core, field, v) \ - __XF_PROXY_WRITE_##field(XF_SHMEM_DATA(core), (v)) - -/* ...individual fields accessors */ -#define __XF_PROXY_READ_cmd_write_idx(proxy) \ - XF_PROXY_READ_ATOMIC(proxy->remote.cmd_write_idx) - -#define __XF_PROXY_READ_cmd_read_idx(proxy) \ - proxy->local.cmd_read_idx - -#define __XF_PROXY_READ_rsp_write_idx(proxy) \ - proxy->local.rsp_write_idx - -#define __XF_PROXY_READ_rsp_read_idx(proxy) \ - XF_PROXY_READ_ATOMIC(proxy->remote.rsp_read_idx) - -/* ...individual fields accessors */ -#define __XF_PROXY_WRITE_cmd_write_idx(proxy, v) \ - XF_PROXY_WRITE_ATOMIC(proxy->remote.cmd_write_idx, v) - -#define __XF_PROXY_WRITE_cmd_read_idx(proxy, v) \ - XF_PROXY_WRITE_ATOMIC(proxy->local.cmd_read_idx, v) - -#define __XF_PROXY_WRITE_rsp_read_idx(proxy, v) \ - XF_PROXY_WRITE_ATOMIC(proxy->remote.rsp_read_idx, v) - -#define __XF_PROXY_WRITE_rsp_write_idx(proxy, v) \ - XF_PROXY_WRITE_ATOMIC(proxy->local.rsp_write_idx, v) - -/* ...command buffer accessor */ -#define XF_PROXY_COMMAND(core, idx) \ - (&XF_SHMEM_DATA((core))->remote.command[(idx)]) - -/* ...response buffer accessor */ -#define XF_PROXY_RESPONSE(core, idx) \ - (&XF_SHMEM_DATA((core))->local.response[(idx)]) - -/******************************************************************************* - * Platform-specific SHMEM enable status - ******************************************************************************/ - -static inline int xf_shmem_enabled(u32 core) -{ - return (core == 0); -} - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...process shared memory interface on given DSP core */ -extern void xf_shmem_process_queues(u32 core); - -/* ...completion callback for message originating from remote proxy */ -extern void xf_msg_proxy_complete(xf_message_t *m); - -/* ...initialize shared memory interface (DSP side) */ -extern int xf_shmem_init(u32 core); diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-sys.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-sys.h deleted file mode 100644 index b82c10eb..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-sys.h +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-sys.h - * - * Definitions for Xtensa SHMEM configuration - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-sys.h mustn't be included directly" -#endif - -/******************************************************************************* - * Standard system includes - ******************************************************************************/ - -/* ...from directory ./board-BOARDNAME */ -#include "xf-board.h" - -/******************************************************************************* - * Global abstractions - ******************************************************************************/ - -/* ...prevent instructions reordering */ -#define barrier() \ - __asm__ __volatile__("": : : "memory") - -/* ...memory barrier */ -#define XF_PROXY_BARRIER() \ - __asm__ __volatile__("memw": : : "memory") - -/* ...memory invalidation */ -#define XF_PROXY_INVALIDATE(buf, length) \ - ({ if ((length)) { xthal_dcache_region_invalidate((buf), (length)); barrier(); } buf; }) - -/* ...memory flushing */ -#define XF_PROXY_FLUSH(buf, length) \ - ({ if ((length)) { barrier(); xthal_dcache_region_writeback((buf), (length)); XF_PROXY_BARRIER(); } buf; }) - -/******************************************************************************* - * Core-specific data accessor - ******************************************************************************/ - -/* ...per-core execution data */ -extern xf_core_data_t xf_core_data[XF_CFG_CORES_NUM]; - -/* ...local memory accessor */ -#define XF_CORE_DATA(core) (&xf_core_data[core]) - -/******************************************************************************* - * Inter-processor communication and shared memory interface definition - ******************************************************************************/ - -#include "xf-ipc.h" diff --git a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-types.h b/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-types.h deleted file mode 100644 index 5f58825f..00000000 --- a/hifi/xaf/hifi-dpf/include/sys/xt-shmem/xf-types.h +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-types.h - * - * Platform-specific typedefs - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-types.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include <stdint.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <assert.h> -#include <errno.h> -#include <xtensa/config/core.h> - -/******************************************************************************* - * Primitive types - ******************************************************************************/ - -typedef unsigned int u32; -typedef signed int s32; -typedef unsigned short u16; -typedef signed short s16; -typedef unsigned char u8; -typedef signed char s8; diff --git a/hifi/xaf/hifi-dpf/include/xa_profiler.h b/hifi/xaf/hifi-dpf/include/xa_profiler.h deleted file mode 100644 index 675ff15c..00000000 --- a/hifi/xaf/hifi-dpf/include/xa_profiler.h +++ /dev/null @@ -1,156 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XA_PROFILER_H__ -#define __XA_PROFILER_H__ - -#if !defined(PROFILE) && __XCC__ -#define PROFILE 1 -#endif - -#if !defined(PREFETCH_CTL) && __XCC__ -#define PREFETCH_CTL 1 -#endif - -#ifdef PROFILE -#include <xtensa/hal.h> -#include <sys/times.h> - -#include "xa_type_def.h" -#include "xa_timer.h" - -TRACE_TAG(MCPS,1); - -typedef struct XA_PROFILER { -#if 1 - unsigned long cstart; - unsigned long cstop; - unsigned long cycles; - unsigned long g_output_bytes; - unsigned long Peak; - unsigned long Sum; - - unsigned long sample_rate; - unsigned long channels; - unsigned long pcm_width; -#else - struct tms start; - struct tms stop; - double Peak; - double Sum; - long long cycles; -#endif - int Peak_frame; - int frame_count; - long long output_bytes; - long long total_cycles; - long long total_samples; - char *id; -} xa_profiler; - -extern xa_profiler prof; - -static inline void xa_compute_mcps(xa_profiler *p_prof, WORD32 samples_decoded, UWORD32 samp_freq, long long gen_strm_pos) -{ - double Ave=0.0, Curr; - - if (samples_decoded <= 0) - return; - - p_prof->total_samples += samples_decoded; - p_prof->frame_count++; - - clock_t cycles = p_prof->cycles; - p_prof->total_cycles = 0; - Curr = ((double) cycles / samples_decoded * samp_freq / 1000000); - - if (p_prof->frame_count > 1) { - p_prof->Sum += Curr; - Ave = p_prof->Sum / (p_prof->frame_count-1); - - if (p_prof->Peak < Curr) { - p_prof->Peak = Curr; - p_prof->Peak_frame = (p_prof->frame_count); - } - } - - unsigned long long total_msec = - (unsigned long long)((double)p_prof->total_samples / samp_freq * 1000.0); - int msec = (int)(total_msec % 1000); - unsigned long long total_seconds = total_msec / 1000; - int seconds = (int)(total_seconds % 60); - int minutes = (int)(total_seconds / 60); - -#if 1 - TRACE(MCPS, _b("[%d] %d:%d.%d MCPS: %d Average: %d samples: %d\n"), - p_prof->frame_count, (uint32_t)minutes, (uint32_t)seconds, (uint32_t)msec, - (uint32_t)Curr, (uint32_t)Ave, samples_decoded); -#else - TRACE(MCPS, _b("[%d|%lld] %d:%02d.%03d MCPS: %.2f Average: %.2f Peak: %.2f @ [%d] %s\n"), - p_prof->frame_count, gen_strm_pos, minutes, seconds, msec, - Curr, Ave, p_prof->Peak, p_prof->Peak_frame, p_prof->id); -#endif - - /* reset counters */ - p_prof->g_output_bytes = 0; - p_prof->cycles = 0; -} - -#define INIT_XA_PROFILER(x, a) do { memset(&x, 0, sizeof(xa_profiler)); \ - x.sample_rate = 48000;\ - x.channels = 2;\ - x.pcm_width = 16;\ - x.id = a; } while(0) - -#define START_TIME_XA_PROFILER(x) do { set_ccount(0); \ - x.cstart=read_ccount(); } while(0) -#define STOP_TIME_XA_PROFILER(x) do { x.cstop =read_ccount(); \ - x.cycles += (x.cstop - x.cstart); } while(0) -#define COMPUTE_MHZ_XA_PROFILER(x, a, b, c) do { xa_compute_mcps(&x, a, b, c); } while(0) -#define SUMMARY_XA_PROFILER(x) do { fprintf(stdout,"\n%5s Peak MCPS = %f\n", x.id, x.Peak); \ - fprintf(stdout,"%5s Peak frame = %d\n", x.id, x.Peak_frame); \ - fprintf(stdout,"%5s Average MCPS = %f\n", x.id, (x.frame_count < 2) ? 0 : (x.Sum/(x.frame_count-1))); } while(0) - -#else - -typedef struct XA_PROFILER { - int place_holder; -} xa_profiler; - -#define INIT_XA_PROFILER(x, a) do {} while(0) -#define START_TIME_XA_PROFILER(x) do {} while(0) -#define STOP_TIME_XA_PROFILER(x) do {} while(0) -#define COMPUTE_MHZ_XA_PROFILER(x, a, b) do {} while(0) -#define SUMMARY_XA_PROFILER(x) do {} while(0) -#endif - -#ifdef PREFETCH_CTL -#define PREFETCH_AGGRESSIVE(x) do { x = xthal_set_cache_prefetch ((XTHAL_DCACHE_PREFETCH_HIGH | XTHAL_ICACHE_PREFETCH_HIGH)); \ - } while(0) -#define PREFETCH_RESTORE(x) do { xthal_set_cache_prefetch (x); } while(0) -#else -#define PREFETCH_AGGRESSIVE(x) do {} while(0) -#define PREFETCH_RESTORE(x) do {} while(0) -#endif - -#endif /* __XA_PROFILER_H__ */ - diff --git a/hifi/xaf/hifi-dpf/include/xa_timer.h b/hifi/xaf/hifi-dpf/include/xa_timer.h deleted file mode 100644 index d45cb4b8..00000000 --- a/hifi/xaf/hifi-dpf/include/xa_timer.h +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -#include <xtensa/xtruntime.h> -#include <xtensa/config/specreg.h> - -extern const unsigned char Xthal_have_ccount; -extern const unsigned char Xthal_num_ccompare; -extern void xthal_set_ccompare(int n, unsigned value); -extern unsigned xthal_get_ccompare(int n); - -/*--------------------------------------------*/ -#include <xtensa/config/core.h> -#define TIMER_INTERVAL 0x1000 - -#define TIMER_INT_MASK (1 << XCHAL_TIMER0_INTERRUPT) -#define TIMER2_INT_MASK (1 << XCHAL_TIMER1_INTERRUPT) -#define TWO_TIMERS_INT_MASK ( TIMER_INT_MASK + TIMER2_INT_MASK ) -#define _XTSTR(x) # x -#define XTSTR(x) _XTSTR(x) - -static __inline__ int read_ccount() -{ - unsigned int ccount; - __asm__ __volatile__ ( - "rsr %0, "XTSTR(CCOUNT) - : "=a" (ccount) - ); - return ccount; -} - -static __inline__ int read_ccompare0() -{ - unsigned int ccompare0; - __asm__ __volatile__ ( - "rsr %0, "XTSTR(CCOMPARE_0) - : "=a" (ccompare0) - ); - return ccompare0; -} - -static __inline__ int read_ccompare1() -{ - unsigned int ccompare1; - __asm__ __volatile__ ( - "rsr %0, "XTSTR(CCOMPARE_1) - : "=a" (ccompare1) - ); - return ccompare1; -} - -static __inline__ unsigned int read_intenable() -{ - unsigned int intenable; - __asm__ __volatile__ ( - "rsr %0, "XTSTR(INTENABLE) - : "=a" (intenable) - ); - return intenable; -} - -static __inline__ void set_ccompare1(int val) -{ - __asm__ __volatile__ ( - "wsr %0, "XTSTR(CCOMPARE_1)"\n\t" - "isync\n\t" - : - : "a" (val) - ); -} - -static __inline__ void set_ccompare0(int val) -{ - __asm__ __volatile__ ( - "wsr %0, "XTSTR(CCOMPARE_0)"\n\t" - "isync\n\t" - : - : "a" (val) - ); -} - -/*---------------------------------------------------*/ - -static __inline__ void set_ccount(int val) -{ - __asm__ __volatile__ ( - "wsr %0, ccount\n" - "isync\n" - : - : "a" (val) - ); -} - diff --git a/hifi/xaf/hifi-dpf/include/xf-component.h b/hifi/xaf/hifi-dpf/include/xf-component.h deleted file mode 100644 index f97f2e48..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-component.h +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-component.h - * - * Xtensa processing framework component definition - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-component.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...component literal identifier */ -typedef const char * const xf_id_t; - -/* ...component descriptor (base structure) */ -typedef struct xf_component -{ - /* ...scheduler node */ - xf_task_t task; - - /* ...component id */ - u32 id; - - /* ...message-processing function */ - int (*entry)(struct xf_component *, xf_message_t *); - - /* ...component destructor function */ - int (*exit)(struct xf_component *, xf_message_t *); -#ifndef XAF_ENABLE_NON_HIKEY - /* ...output port accessor */ - xf_output_port_t * (*port)(struct xf_component *, u32); -#endif - -} xf_component_t; - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...return core-id of the component */ -static inline u32 xf_component_core(xf_component_t *component) -{ - return XF_PORT_CORE(component->id); -} - -/* ...schedule component execution */ -#define xf_component_schedule(c, dts) \ -({ \ - xf_sched_t *__sched = &XF_CORE_DATA(xf_component_core((c)))->sched; \ - xf_sched_put(__sched, &(c)->task, xf_sched_timestamp(__sched) + (dts)); \ -}) - -/* ...cancel component execution */ -#define xf_component_cancel(c) \ -({ \ - xf_sched_t *__sched = &XF_CORE_DATA(xf_component_core((c)))->sched; \ - xf_sched_cancel(__sched, &(c)->task); \ -}) - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...component factory */ -extern xf_component_t * xf_component_factory(u32 core, xf_id_t id, u32 length); diff --git a/hifi/xaf/hifi-dpf/include/xf-core.h b/hifi/xaf/hifi-dpf/include/xf-core.h deleted file mode 100644 index 4daea6f2..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-core.h +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-core.h - * - * DSP processing framework core definitions - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-core.h mustn't be included directly" -#endif - -/******************************************************************************* - * Shared core data - ******************************************************************************/ - -/* ...core data with read-only access from remote cores */ -typedef struct xf_core_ro_data -{ - /* ...platform-specific multi-core mutex data (want to have an array? - tbd) */ - xf_mutex_t lock; - - /* ...opaque platform-specific IPC-data handle */ - xf_ipc_handle_t ipc; - - /* ...shared memory message pool data - here? - tbd */ - xf_msg_pool_t pool; - - /* ...anything else? - tbd */ - -} xf_core_ro_data_t; - -/* ...core data with read-write access from remote cores */ -typedef struct xf_core_rw_data -{ - /* ...message queue containing local commands/responses */ - xf_msg_queue_t local; - - /* ...message queue containing responses to remote proxy (if enabled) */ - xf_msg_queue_t remote; - - /* ...pointer to shared memory data? anything else? - tbd */ - -} xf_core_rw_data_t; - -/* ...proper cache-line aligned core data */ -XF_ALIGNED_TYPEDEF(xf_core_ro_data_t, __xf_core_ro_data_t); -XF_ALIGNED_TYPEDEF(xf_core_rw_data_t, __xf_core_rw_data_t); - -/******************************************************************************* - * Global data definition - hmm... - tbd - ******************************************************************************/ - -/* ...per-core shared memory with read-only remote access */ -extern __xf_core_ro_data_t xf_core_ro_data[XF_CFG_CORES_NUM]; - -/* ...per-core shared memory with read-write remote access */ -extern __xf_core_rw_data_t xf_core_rw_data[XF_CFG_CORES_NUM]; - -/* ...shared read-only memory access */ -#define XF_CORE_RO_DATA(core) ((xf_core_ro_data_t *)(&xf_core_ro_data[(core)])) - -/* ...shared read-write memory access */ -#define XF_CORE_RW_DATA(core) ((xf_core_rw_data_t *)(&xf_core_rw_data[(core)])) - -/******************************************************************************* - * Local core data (not accessible from remote cores) - ******************************************************************************/ - -/* ...component map entry */ -typedef union xf_cmap_link -{ - /* ...poiner to active client */ - xf_component_t *c; - - /* ...index to a client in the list (values 0..XF_CFG_MAX_CLIENTS) */ - u32 next; - -} xf_cmap_link_t; - -/* ...per-core local data */ -typedef struct xf_core_data -{ - /* ...scheduler queue (sorted by execution timestamp) */ - xf_sched_t sched; - - /* ...command/response queue for communication within local core (including ISRs) */ - xf_msg_queue_t queue; - - /* ...pending response queue (submitted from ISR context) */ - xf_msg_queue_t response; - - /* ...per-core component mapping */ - xf_cmap_link_t cmap[XF_CFG_MAX_CLIENTS]; - - /* ...index of first free client */ - u32 free; - - /* ...local DSP memory pool */ - xf_mm_pool_t local_pool; - - /* ...shared AP-DSP memory pool (if enabled) */ - xf_mm_pool_t shared_pool; - - /* ...opaque system-specific shared memory data handle */ - xf_shmem_handle_t shmem; - - /* ...scratch memory pointer */ - void *scratch; - - /* ...tracer data */ - xf_trace_data_t trace; - - /* ...any debugging information? for memory allocation etc... ? */ - -} xf_core_data_t; - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...initialize per-core framework data */ -extern int xf_core_init(u32 core); - -/* ...global data initialization function */ -extern int xf_global_init(void); - -/* ...process core events */ -extern void xf_core_service(u32 core); diff --git a/hifi/xaf/hifi-dpf/include/xf-debug.h b/hifi/xaf/hifi-dpf/include/xf-debug.h deleted file mode 100644 index c416cc01..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-debug.h +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-debug.h - * - * Debugging interface for Xtensa Audio DSP codec server - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-debug.h mustn't be included directly" -#endif - -#include "dsp_debug.h" - -/******************************************************************************* - * Auxiliary macros (put into "xf-types.h"?) - ******************************************************************************/ - -#ifndef offset_of -#define offset_of(type, member) \ - ((int)&(((const type *)(0))->member)) -#endif - -#ifndef container_of -#define container_of(ptr, type, member) \ - ((type *)((void *)(ptr) - offset_of(type, member))) -#endif - -/* ...next power-of-two calculation */ -#define xf_next_power_of_two(v) __xf_power_of_two_1((v) - 1) -#define __xf_power_of_two_1(v) __xf_power_of_two_2((v) | ((v) >> 1)) -#define __xf_power_of_two_2(v) __xf_power_of_two_3((v) | ((v) >> 2)) -#define __xf_power_of_two_3(v) __xf_power_of_two_4((v) | ((v) >> 4)) -#define __xf_power_of_two_4(v) __xf_power_of_two_5((v) | ((v) >> 8)) -#define __xf_power_of_two_5(v) __xf_power_of_two_6((v) | ((v) >> 16)) -#define __xf_power_of_two_6(v) ((v) + 1) - -/* ...check if non-zero value is a power-of-two */ -#define xf_is_power_of_two(v) (((v) & ((v) - 1)) == 0) - -/******************************************************************************* - * Bug check for constant conditions (file scope) - ******************************************************************************/ - -#define __C_BUG(n) __C_BUG2(n) -#define __C_BUG2(n) __c_bug_##n -#define C_BUG(expr) typedef char __C_BUG(__LINE__)[(expr) ? -1 : 1] - -/******************************************************************************* - * Compilation-time types control - ******************************************************************************/ - -#if XF_DEBUG -#define __C_TYPE_CONTROL(d, type) ((void) ((d) != (type*) 0)) -#else -#define __C_TYPE_CONTROL(d, type) ((void) 0) -#endif - -/******************************************************************************* - * Unused variable - ******************************************************************************/ - -#define C_UNUSED(v) (void)(0 ? (v) = (v), 1 : 0) - -/******************************************************************************* - * Auxiliary macros - ******************************************************************************/ - -/* ...define a stub for unused declarator */ -#define __xf_stub(tag, line) __xf_stub2(tag, line) -#define __xf_stub2(tag, line) typedef int __xf_##tag##_##line - -/* ...convert anything into string */ -#define __xf_string(x) __xf_string2(x) -#define __xf_string2(x) #x - -/******************************************************************************* - * Tracing facility - ******************************************************************************/ - -#if XF_TRACE - -/* ...tracing to communication processor */ -extern int xf_trace(const char *format, ...) __attribute__((format (printf, 1, 2))); - -/* ...tracing facility initialization */ -extern void xf_trace_init(const char *banner); - -/* ...initialize tracing facility */ -//#define TRACE_INIT(banner) (xf_trace_init(banner)) -#define TRACE_INIT(banner) ({ dsp_debug_init(); DSP_TRACE("\n"banner); }) - -/* ...trace tag definition */ -#define TRACE_TAG(tag, on) enum { __xf_trace_##tag = on } - -/* ...check if the trace tag is enabled */ -#define TRACE_CFG(tag) (__xf_trace_##tag) - -/* ...tagged tracing primitive */ -#define TRACE(tag, fmt, ...) (void)(__xf_trace_##tag ? __xf_trace(tag, __xf_format##fmt, ## __VA_ARGS__), 1 : 0) - -/******************************************************************************* - * Tagged tracing formats - ******************************************************************************/ - -/* ...tracing primitive */ -#define __xf_trace(tag, fmt, ...) \ - ({ __attribute__((unused)) const char *__xf_tag = #tag; DSP_TRACE(fmt, ## __VA_ARGS__); }) - -/* ...just a format string */ -#define __xf_format_n(fmt) fmt - -/* ...module tag and trace tag shown */ -#define __xf_format_b(fmt) "[%s.%s] " fmt, __xf_string(MODULE_TAG), __xf_tag - -/* ...module tag, trace tag, file name and line shown */ -#define __xf_format_x(fmt) "[%s.%s] - %s@%d - " fmt, __xf_string(MODULE_TAG), __xf_tag, __FILE__, __LINE__ - -/******************************************************************************* - * Globally defined tags - ******************************************************************************/ - -/* ...unconditionally OFF */ -TRACE_TAG(0, 0); - -/* ...unconditionally ON */ -TRACE_TAG(1, 1); - -/* ...error output - on by default */ -TRACE_TAG(ERROR, 1); - -#else - -#define TRACE_INIT(banner) (void)0 -#define TRACE_TAG(tag, on) __xf_stub(trace_##tag, __LINE__) -#define TRACE_CFG(tag) 0 -#define TRACE(tag, fmt, ...) (void)0 -#define __xf_trace(tag, fmt, ...) (void)0 - -#endif /* XF_TRACE */ - -/******************************************************************************* - * Bugchecks - ******************************************************************************/ - -#if XF_DEBUG - -/* ...run-time bugcheck */ -#define BUG(cond, fmt, ...) \ -do \ -{ \ - if (cond) \ - { \ - /* ...output message */ \ - __xf_trace(BUG, __xf_format##fmt, ## __VA_ARGS__); \ - \ - /* ...and die (tbd) */ \ - __xf_abort(); \ - } \ -} \ -while (0) - -#else -#define BUG(cond, fmt, ...) (void)0 -#endif /* XF_DEBUG */ - -/******************************************************************************* - * Run-time error processing - ******************************************************************************/ - -/* ...check the API call succeeds */ -#define XF_CHK_API(cond) \ -({ \ - int __ret; \ - \ - if ((__ret = (int)(cond)) < 0) \ - { \ - TRACE(ERROR, _x("API error: %d"), __ret); \ - return __ret; \ - } \ - __ret; \ -}) - -/* ...check the condition is true */ -#define XF_CHK_ERR(cond, error) \ -({ \ - int __ret; \ - \ - if (!(__ret = (int)(cond))) \ - { \ - TRACE(ERROR, _x("check failed: %d"), __ret); \ - return (error); \ - } \ - __ret; \ -}) diff --git a/hifi/xaf/hifi-dpf/include/xf-io.h b/hifi/xaf/hifi-dpf/include/xf-io.h deleted file mode 100644 index 17019a73..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-io.h +++ /dev/null @@ -1,298 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-io.h - * - * Input/output data ports - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-io.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...input port with interim buffer */ -typedef struct xf_input_port -{ - /* ...message queue */ - xf_msg_queue_t queue; - - /* ...internal contiguous buffer to store incoming data */ - void *buffer; - - /* ...size of internal buffer */ - u32 length; - - /* ...current writing position in the buffer */ - u32 filled; - - /* ...interim pointer to input message buffer */ - void *access; - - /* ...remaining length of current input message */ - u32 remaining; - - /* ...execution flags */ - u32 flags; - -} xf_input_port_t; - -/******************************************************************************* - * Input port flags - ******************************************************************************/ - -/* ...data enabled */ -#define XF_INPUT_FLAG_CREATED (1 << 0) - -/* ...data enabled */ -#define XF_INPUT_FLAG_ENABLED (1 << 1) - -/* ...end-of-stream condition */ -#define XF_INPUT_FLAG_EOS (1 << 2) - -/* ...stream completed */ -#define XF_INPUT_FLAG_DONE (1 << 3) - -/* ...stream purging sequence */ -#define XF_INPUT_FLAG_PURGING (1 << 4) - -/* ...base input port flags mask */ -#define __XF_INPUT_FLAGS(flags) ((flags) & ((1 << 5) - 1)) - -/* ...custom input port flag */ -#define __XF_INPUT_FLAG(f) ((f) << 5) - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...test if input port is created */ -static inline int xf_input_port_created(xf_input_port_t *port) -{ - return (port->flags & XF_INPUT_FLAG_CREATED); -} - -/* ...check if input port is ready (has pending message) */ -static inline int xf_input_port_ready(xf_input_port_t *port) -{ - return (xf_msg_queue_head(&port->queue) != NULL); -} - -/* ...test if input port entered end-of-stream condition */ -static inline int xf_input_port_done(xf_input_port_t *port) -{ - return (port->flags & XF_INPUT_FLAG_DONE); -} - -/* ...check if port is in bypass mode */ -static inline int xf_input_port_bypass(xf_input_port_t *port) -{ - return port->buffer == NULL; -} - -/* ...bypass port only: check if there is a data available */ -static inline void * xf_input_port_data(xf_input_port_t *port) -{ - return port->access; -} - -/* ...bypass port only: get remaining length of current message */ -static inline u32 xf_input_port_length(xf_input_port_t *port) -{ - return port->remaining; -} - -/* ...non-bypass port only: get current fill level */ -static inline u32 xf_input_port_level(xf_input_port_t *port) -{ - return port->filled; -} - -/******************************************************************************* - * Output port data - ******************************************************************************/ - -typedef struct xf_output_port -{ - /* ...pending message queue */ - xf_msg_queue_t queue; - - /* ...message pool */ - xf_msg_pool_t pool; - - /* ...saved port unrouting message */ - xf_message_t *unroute; - - /* ...length of output buffer */ - u32 length; - - /* ...output port flags */ - u32 flags; - -} xf_output_port_t; - -/******************************************************************************* - * Output port flags - ******************************************************************************/ - -/* ...port is created */ -#define XF_OUTPUT_FLAG_CREATED (1 << 0) - -/* ...port is routed */ -#define XF_OUTPUT_FLAG_ROUTED (1 << 1) - -/* ...data enabled */ -#define XF_OUTPUT_FLAG_ENABLED (1 << 2) - -/* ...stream completed */ -#define XF_OUTPUT_FLAG_DONE (1 << 3) - -/* ...flushing sequence is on-going */ -#define XF_OUTPUT_FLAG_FLUSHING (1 << 4) - -/* ...port is idle - no outstanding messages */ -#define XF_OUTPUT_FLAG_IDLE (1 << 5) - -/* ...port is being unrouted */ -#define XF_OUTPUT_FLAG_UNROUTING (1 << 6) - -/* ...base output port flags accessor */ -#define __XF_OUTPUT_FLAGS(flags) ((flags) & ((1 << 7) - 1)) - -/* ...custom output port flag */ -#define __XF_OUTPUT_FLAG(f) ((f) << 7) - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...test if input port is created */ -static inline int xf_output_port_created(xf_output_port_t *port) -{ - return (port->flags & XF_OUTPUT_FLAG_CREATED); -} - -/* ...check if port is routed */ -static inline int xf_output_port_routed(xf_output_port_t *port) -{ - return ((port->flags & XF_OUTPUT_FLAG_ROUTED) != 0); -} - -/* ...check if port unrouting sequence is ongoing */ -static inline int xf_output_port_unrouting(xf_output_port_t *port) -{ - return ((port->flags & XF_OUTPUT_FLAG_UNROUTING) != 0); -} - -/* ...check if port is idle (owns all data buffers) */ -static inline int xf_output_port_idle(xf_output_port_t *port) -{ - return ((port->flags & XF_OUTPUT_FLAG_IDLE) != 0); -} - -/* ...check if port is ready (has output buffers - better use flags - tbd) */ -static inline int xf_output_port_ready(xf_output_port_t *port) -{ - return (xf_msg_queue_head(&port->queue) != NULL && !xf_output_port_unrouting(port)); -} - -/* ...output port flow-control message accessor */ -static inline xf_message_t * xf_output_port_control_msg(xf_output_port_t *port) -{ - return xf_msg_pool_item(&port->pool, 0); -} - -/******************************************************************************* - * Input port API - ******************************************************************************/ - -/* ...initialize input port structure */ -extern int xf_input_port_init(xf_input_port_t *port, u32 size, u32 align, u32 core); - -/* ...put message into input port queue */ -extern int xf_input_port_put(xf_input_port_t *port, xf_message_t *m); - -/* ...fill-in required amount of data into input port buffer */ -extern int xf_input_port_fill(xf_input_port_t *port); - -/* ...pad input buffer with given value */ -extern void xf_input_port_pad(xf_input_port_t *port, u8 pad); - -/* ...consume bytes from input buffer */ -extern void xf_input_port_consume(xf_input_port_t *port, u32 n); - -/* ...purge input port queue */ -extern void xf_input_port_purge(xf_input_port_t *port); - -/* ...save flow-control message for propagated input port purging sequence */ -extern void xf_input_port_control_save(xf_input_port_t *port, xf_message_t *m); - -/* ...complete input port purging sequence */ -extern void xf_input_port_purge_done(xf_input_port_t *port); - -/* ...destroy input port data */ -extern void xf_input_port_destroy(xf_input_port_t *port, u32 core); - -/******************************************************************************* - * Output port API - ******************************************************************************/ - -/* ...initialize output port structure */ -extern int xf_output_port_init(xf_output_port_t *port, u32 size); - -/* ...put next message to the output port */ -extern int xf_output_port_put(xf_output_port_t *port, xf_message_t *m); - -/* ...get data buffer of output message */ -extern void * xf_output_port_data(xf_output_port_t *port); - -/* ...route output port */ -extern int xf_output_port_route(xf_output_port_t *port, u32 id, u32 n, u32 length, u32 align); - -/* ...unroute output port */ -extern void xf_output_port_unroute(xf_output_port_t *port); - -/* ...start output port unrouting sequence */ -extern void xf_output_port_unroute_start(xf_output_port_t *port, xf_message_t *m); - -/* ...complete port unrouting sequence */ -extern void xf_output_port_unroute_done(xf_output_port_t *port); - -/* ...produce output message marking amount of bytes produced */ -extern int xf_output_port_produce(xf_output_port_t *port, u32 n); - -/* ...purge output port */ -extern void xf_output_port_purge(xf_output_port_t *port); - -/* ...flush output port and return non-zero result if sequence is over */ -extern int xf_output_port_flush(xf_output_port_t *port, u32 opcode); - -/* ...complete flushing sequence */ -extern void xf_output_port_flush_done(xf_output_port_t *port); - -/* ...destroy output port data */ -extern void xf_output_port_destroy(xf_output_port_t *port, u32 core); diff --git a/hifi/xaf/hifi-dpf/include/xf-mm.h b/hifi/xaf/hifi-dpf/include/xf-mm.h deleted file mode 100644 index 712ea14a..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-mm.h +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-mm.h - * - * Generic dynamic memory manager (based on rb-tree index) - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-mem.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...red-black trees library */ -#include "lib/rbtree.h" - -/******************************************************************************* - * Cache-line aligned types - ******************************************************************************/ - -/* ...proper cache-line alignment */ -#define XF_ALIGNED(size) \ - (((size) + XF_PROXY_ALIGNMENT - 1) & ~(XF_PROXY_ALIGNMENT - 1)) - -/* ...cache-line aligned type identifier */ -#define XF_ALIGNED_TYPE(type) \ - __xf_aligned_##type - -/* ...definition of cache-line aligned type */ -#define XF_ALIGNED_TYPEDEF(type, name) \ -typedef union \ -{ \ - /* ...item of original type */ \ - type __obj; \ - \ - /* ...padding to cache-line */ \ - u8 __pad[XF_ALIGNED(sizeof(type))]; \ - \ -} XF_ALIGNED_TYPE(type), name __xf_shmem__ - -/* ...accessor to original type */ -#define XF_ALIGNED_OBJ(p) \ - (&(p)->__obj) - -#define XF_IS_ALIGNED(p) \ - (((u32)(p) & (XF_PROXY_ALIGNMENT - 1)) == 0) - -/******************************************************************************* - * Memory pool description - ******************************************************************************/ - -/* ...memory allocator data */ -typedef struct xf_mm_pool -{ - /* ...free blocks map sorted by block length */ - rb_tree_t l_map; - - /* ...free blocks map sorted by address of the block */ - rb_tree_t a_map; - - /* ...address of memory pool (32-bytes aligned at least); need that? - tbd */ - void *addr; - - /* ...length of the pool (multiple of descriptor size); need that? - tbd */ - u32 size; - -} xf_mm_pool_t; - -/* ...descriptor of free memory block */ -typedef struct xf_mm_block -{ - /* ...rb-tree node in a block-length map */ - rb_node_t l_node; - - /* ...rb-tree node in a block-address map */ - rb_node_t a_node; - -} xf_mm_block_t; - -/* ...properly aligned allocation unit */ -typedef u8 xf_mm_item[xf_next_power_of_two(sizeof(xf_mm_block_t))]; - -/* ...macro to assure proper alignment of dynamically allocated data */ -#define XF_MM(size) (((size) + sizeof(xf_mm_item) - 1) & ~(sizeof(xf_mm_item) - 1)) - -/* ...check if memory is properly aligned */ -#define XF_MM_ALIGNED(size) (!((size) & (sizeof(xf_mm_item) - 1))) - -/* ...alignement definition */ -#define __xf_mm__ __attribute__((__aligned__(sizeof(xf_mm_item)))) - -/******************************************************************************* - * Dynamically allocated buffer - ******************************************************************************/ - -/* ...memory allocation metadata */ -typedef struct xf_mm_buffer -{ - /* ...allocation address */ - void *addr; - - /* ...length */ - u32 size; - -} __xf_mm__ xf_mm_buffer_t; - -/******************************************************************************* - * API functions - ******************************************************************************/ - -/* ...pool initialization */ -extern int xf_mm_init(xf_mm_pool_t *pool, void *addr, u32 size); - -/* ...block allocation */ -extern void * xf_mm_alloc(xf_mm_pool_t *pool, u32 size); - -/* ...block deallocation */ -extern void xf_mm_free(xf_mm_pool_t *pool, void *addr, u32 size); diff --git a/hifi/xaf/hifi-dpf/include/xf-msg.h b/hifi/xaf/hifi-dpf/include/xf-msg.h deleted file mode 100644 index 3448425b..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-msg.h +++ /dev/null @@ -1,252 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-msg.h - * - * Internal messages, and message queues. - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-msg.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...forward declaration */ -typedef struct xf_message xf_message_t; - -/* ...audio command/response message (internal to DSP processing framework) */ -struct xf_message -{ - /* ...pointer to next item in the list */ - xf_message_t *next; - - /* ...shmem session_id */ - u32 id; - - /* ...operation code */ - u32 opcode; - - /* ...length of attached message buffer */ - u32 length; - - /* ...message buffer (translated virtual address) */ - void *buffer; -#ifndef XAF_ENABLE_NON_HIKEY - uint64_t v_buffer; -#endif -}; - -/* ...cache-line aligned message buffer */ -XF_ALIGNED_TYPEDEF(xf_message_t, __xf_message_t); - -/* ...message pool definition */ -typedef struct xf_msg_pool -{ - /* ...array of aligned messages */ - __xf_message_t *p; - - /* ...pointer to first free item in the pool */ - __xf_message_t *head; - - /* ...total size of the pool */ - u32 n; - -} xf_msg_pool_t; - -/* ...message accessor */ -static inline xf_message_t * xf_msg_pool_item(xf_msg_pool_t *pool, u32 i) -{ - return (xf_message_t *) &pool->p[i]; -} - -/******************************************************************************* - * Message queue data - ******************************************************************************/ - -/* ...message queue (single-linked FIFO list) */ -typedef struct xf_msg_queue -{ - /* ...head of the queue */ - xf_message_t *head; - - /* ...tail pointer */ - xf_message_t *tail; - -} xf_msg_queue_t; - -/******************************************************************************* - * Message queue API - ******************************************************************************/ - -/* ...initialize message queue */ -static inline void xf_msg_queue_init(xf_msg_queue_t *queue) -{ - queue->head = queue->tail = NULL; -} - -/* ...push message in FIFO queue */ -static inline int xf_msg_enqueue(xf_msg_queue_t *queue, xf_message_t *m) -{ - int empty = (queue->head == NULL); - - /* ...set list terminating pointer */ - m->next = NULL; - - if (empty) - queue->head = m; - else - queue->tail->next = m; - - /* ...advance tail pointer */ - queue->tail = m; - - /* ...return emptiness status */ - return empty; -} - -#define xf_msg_enqueue(queue, m) \ -({ \ - BUG((m)->next != NULL, _x("message is active: %p"), (m)); \ - (xf_msg_enqueue)((queue), (m)); \ -}) - -/* ...retrieve (pop) next message from FIFO queue */ -static inline xf_message_t * xf_msg_dequeue(xf_msg_queue_t *queue) -{ - xf_message_t *m = queue->head; - - /* ...check if there is anything in the queue and dequeue it */ - if (m != NULL) - { - /* ...advance head to the next entry in the queue */ - if ((queue->head = m->next) == NULL) - queue->tail = NULL; - - /* ...debug - wipe out next pointer */ - m->next = NULL; - } - - return m; -} - -/* ...test if message queue is empty */ -static inline int xf_msg_queue_empty(xf_msg_queue_t *queue) -{ - return (queue->head == NULL); -} - -/* ...get message queue head pointer */ -static inline xf_message_t * xf_msg_queue_head(xf_msg_queue_t *queue) -{ - return queue->head; -} - -/* ...check if message belongs to a pool */ -static inline int xf_msg_from_pool(xf_msg_pool_t *pool, xf_message_t *m) -{ - return (u32)((__xf_message_t*)m - pool->p) < pool->n; -} - -/******************************************************************************* - * Global message pool API - ******************************************************************************/ - -/* ...submit message execution on local DSP core */ -extern void xf_msg_schedule(xf_message_t *m, u32 ts); - -/* ...schedule message execution from ISR context */ -extern void xf_msg_schedule_isr(xf_message_t *m); - -/* ...submit message for execution on some DSP */ -extern void xf_msg_submit(xf_message_t *m); - -/* ...cancel local (scheduled on current core) message execution */ -extern void xf_msg_cancel(xf_message_t *m); - -/* ...complete message processing */ -extern void xf_msg_complete(xf_message_t *m); - -/* ...complete message from ISR context */ -extern void xf_msg_complete_isr(xf_message_t *m); - -/* ...allocate message pool on specific core */ -extern int xf_msg_pool_init(xf_msg_pool_t *pool, u32 n, u32 core); - -/* ...allocate message from a pool (no concurrent access from other cores) */ -extern xf_message_t * xf_msg_pool_get(xf_msg_pool_t *pool); - -/* ...return message back to the pool (no concurrent access from other cores) */ -extern void xf_msg_pool_put(xf_msg_pool_t *pool, xf_message_t *m); - -/* ...destroy message pool */ -extern void xf_msg_pool_destroy(xf_msg_pool_t *pool, u32 core); - -/* ...indicate whether pool of free messages is empty */ -extern int xf_message_pool_empty(void); - -/* ...initialize global pool of messages */ -extern void xf_message_pool_init(void); - -/******************************************************************************* - * Auxiliary helpers - ******************************************************************************/ - -/* ...send response message to caller */ -static inline void xf_response(xf_message_t *m) -{ - xf_msg_complete(m); -} - -/* ...send response message with output buffer */ -static inline void xf_response_data(xf_message_t *m, u32 length) -{ - /* ...adjust message output buffer */ - m->length = length; - - /* ...return message to originator */ - xf_msg_complete(m); -} - -/* ...send generic "ok" message (no data buffer) */ -static inline void xf_response_ok(xf_message_t *m) -{ - /* ...adjust message output buffer */ - m->length = 0; - - /* ...return message to originator */ - xf_msg_complete(m); -} - -/* ...send error-response message */ -static inline void xf_response_err(xf_message_t *m) -{ - /* ...set generic error message */ - m->opcode = XF_UNREGISTER, m->length = 0; - - /* ...return message to originator */ - xf_msg_complete(m); -} diff --git a/hifi/xaf/hifi-dpf/include/xf-opcode.h b/hifi/xaf/hifi-dpf/include/xf-opcode.h deleted file mode 100644 index 6fa08465..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-opcode.h +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-opcode.h - * - * Xtensa audio processing framework. Message API - * - ******************************************************************************/ - -#ifndef __XF_H -#error "xf-opcode.h mustn't be included directly" -#endif - -/******************************************************************************* - * Message routing composition - move somewhere else - tbd - ******************************************************************************/ - -/* ...adjust IPC client of message going from user-space */ -#define XF_MSG_AP_FROM_USER(id, client) \ - (((id) & ~(0xF << 2)) | (client)) - -/* ...wipe out IPC client from message going to user-space */ -#define XF_MSG_AP_TO_USER(id) \ - ((id) & ~(0xF << 18)) - -/* ...port specification (12 bits) */ -#define __XF_PORT_SPEC(core, id, port) ((core) | ((id) << 2) | ((port) << 8)) -#define __XF_PORT_SPEC2(id, port) ((id) | ((port) << 8)) -#define XF_PORT_CORE(spec) ((spec) & 0x3) -#define XF_PORT_CLIENT(spec) (((spec) >> 2) & 0x3F) -#define XF_PORT_ID(spec) (((spec) >> 8) & 0xF) - -/* ...message id contains source and destination ports specification */ -#define __XF_MSG_ID(src, dst) (((src) & 0xFFFF) | (((dst) & 0xFFFF) << 16)) -#define XF_MSG_SRC(id) (((id) >> 0) & 0xFFFF) -#define XF_MSG_SRC_CORE(id) (((id) >> 0) & 0x3) -#define XF_MSG_SRC_CLIENT(id) (((id) >> 2) & 0x3F) -#define XF_MSG_SRC_ID(id) (((id) >> 0) & 0xFF) -#define XF_MSG_SRC_PORT(id) (((id) >> 8) & 0xF) -#define XF_MSG_SRC_PROXY(id) (((id) >> 15) & 0x1) -#define XF_MSG_DST(id) (((id) >> 16) & 0xFFFF) -#define XF_MSG_DST_CORE(id) (((id) >> 16) & 0x3) -#define XF_MSG_DST_CLIENT(id) (((id) >> 18) & 0x3F) -#define XF_MSG_DST_ID(id) (((id) >> 16) & 0xFF) -#define XF_MSG_DST_PORT(id) (((id) >> 24) & 0xF) -#define XF_MSG_DST_PROXY(id) (((id) >> 31) & 0x1) - -/* ...special treatment of AP-proxy destination field */ -#define XF_AP_IPC_CLIENT(id) (((id) >> 18) & 0xF) -#define XF_AP_CLIENT(id) (((id) >> 22) & 0x1FF) -#define __XF_AP_PROXY(core) ((core) | 0x8000) -#define __XF_DSP_PROXY(core) ((core) | 0x8000) -#define __XF_AP_CLIENT(core, client) ((core) | ((client) << 6) | 0x8000) - -/* ...check if DSP message is shared between cores */ -#define XF_MSG_SHARED(id) \ - ({ u32 __id = (id); (XF_CFG_CORES_NUM > 1 ? (__id ^ (__id >> 16)) & 0x3 : 0); }) - -/******************************************************************************* - * Opcode composition - ******************************************************************************/ - -/* ...opcode composition with command/response data tags */ -#define __XF_OPCODE(c, r, op) (((c) << 31) | ((r) << 30) | ((op) & 0x3F)) - -/* ...accessors */ -#define XF_OPCODE_CDATA(opcode) ((opcode) & (1 << 31)) -#define XF_OPCODE_RDATA(opcode) ((opcode) & (1 << 30)) -#define XF_OPCODE_TYPE(opcode) ((opcode) & (0x3F)) - -/******************************************************************************* - * Opcode types - ******************************************************************************/ - -/* ...unregister client */ -#define XF_UNREGISTER __XF_OPCODE(0, 0, 0) - -/* ...register client at proxy */ -#define XF_REGISTER __XF_OPCODE(1, 0, 1) - -/* ...port routing command */ -#define XF_ROUTE __XF_OPCODE(1, 0, 2) - -/* ...port unrouting command */ -#define XF_UNROUTE __XF_OPCODE(1, 0, 3) - -/* ...shared buffer allocation */ -#define XF_ALLOC __XF_OPCODE(0, 0, 4) - -/* ...shared buffer freeing */ -#define XF_FREE __XF_OPCODE(0, 0, 5) - -/* ...set component parameters */ -#define XF_SET_PARAM __XF_OPCODE(1, 0, 6) - -/* ...get component parameters */ -#define XF_GET_PARAM __XF_OPCODE(1, 1, 7) - -/* ...input buffer reception */ -#define XF_EMPTY_THIS_BUFFER __XF_OPCODE(1, 0, 8) - -/* ...output buffer reception */ -#define XF_FILL_THIS_BUFFER __XF_OPCODE(0, 1, 9) - -/* ...flush specific port */ -#define XF_FLUSH __XF_OPCODE(0, 0, 10) - -/* ...start component operation */ -#define XF_START __XF_OPCODE(0, 0, 11) - -/* ...stop component operation */ -#define XF_STOP __XF_OPCODE(0, 0, 12) - -/* ...pause component operation */ -#define XF_PAUSE __XF_OPCODE(0, 0, 13) - -/* ...resume component operation */ -#define XF_RESUME __XF_OPCODE(0, 0, 14) - -/* ...extended parameter setting function */ -#define XF_SET_PARAM_EXT __XF_OPCODE(1, 1, 15) - -/* ...extended parameter retrieval function */ -#define XF_GET_PARAM_EXT __XF_OPCODE(1, 1, 16) - -/* ...total amount of supported decoder commands */ -#define __XF_OP_NUM 17 - -/******************************************************************************* - * XF_START message definition - ******************************************************************************/ - -typedef struct xf_start_msg -{ - /* ...effective sample rate */ - u32 sample_rate; - - /* ...number of channels */ - u32 channels; - - /* ...sample width */ - u32 pcm_width; - - /* ...minimal size of intput buffer */ - u32 input_length; - - /* ...size of output buffer */ - u32 output_length; - -} __attribute__((__packed__)) xf_start_msg_t; - -/******************************************************************************* - * XF_GET_PARAM message - ******************************************************************************/ - -/* ...message body (command/response) */ -typedef union xf_get_param_msg -{ - /* ...command structure */ - struct - { - /* ...array of parameters requested */ - u32 id[0]; - - } __attribute__((__packed__)) c; - - /* ...response structure */ - struct - { - /* ...array of parameters values */ - u32 value[0]; - - } __attribute__((__packed__)) r; - -} xf_get_param_msg_t; - -/* ...length of the XF_GET_PARAM command/response */ -#define XF_GET_PARAM_CMD_LEN(params) (sizeof(u32) * (params)) -#define XF_GET_PARAM_RSP_LEN(params) (sizeof(u32) * (params)) - -/******************************************************************************* - * XF_SET_PARAM message - ******************************************************************************/ - -/* ...component initialization parameter */ -typedef struct xf_set_param_item -{ - /* ...index of parameter passed to SET_CONFIG_PARAM call */ - u32 id; - - /* ...value of parameter */ - u32 value; - -} __attribute__ ((__packed__)) xf_set_param_item_t; - -/* ...message body (no response message? - tbd) */ -typedef struct xf_set_param_msg -{ - /* ...command message */ - xf_set_param_item_t item[0]; - -} __attribute__ ((__packed__)) xf_set_param_msg_t; - -/* ...length of the command message */ -#define XF_SET_PARAM_CMD_LEN(params) (sizeof(xf_set_param_item_t) * (params)) - -/******************************************************************************* - * XF_SET_PARAM_EXT/XF_GET_PARAM_EXT message - ******************************************************************************/ - -/* ...extended parameter descriptor */ -typedef struct xf_ext_param_desc -{ - /* ...index of parameter passed to SET/GET_CONFIG_PARAM call (16-bits only) */ - u16 id; - - /* ...length of embedded input/output parameter data (in bytes) */ - u16 length; - -} __attribute__ ((__packed__, __aligned__(4))) xf_ext_param_desc_t; - -/* ...message body (no response message? - tbd) */ -typedef struct xf_ext_param_msg -{ - /* ...extended parameter descriptor */ - xf_ext_param_desc_t desc; - - /* ...parameter data (in the format expected by codec; 4 bytes aligned) */ - u8 data[0]; - -} __attribute__ ((__packed__, __aligned__(4))) xf_ext_param_msg_t; - -/******************************************************************************* - * XF_ROUTE definition - ******************************************************************************/ - -/* ...port routing command */ -typedef struct xf_route_port_msg -{ - /* ...source port specification */ - u32 src; - - /* ...destination port specification */ - u32 dst; - - /* ...number of buffers to allocate */ - u32 alloc_number; - - /* ...length of buffer to allocate */ - u32 alloc_size; - - /* ...alignment restriction for a buffer */ - u32 alloc_align; - -} __attribute__((__packed__)) xf_route_port_msg_t; - -/******************************************************************************* - * XF_UNROUTE definition - ******************************************************************************/ - -/* ...port unrouting command */ -typedef struct xf_unroute_port_msg -{ - /* ...source port specification */ - u32 src; - - /* ...destination port specification */ - u32 dst; - -} __attribute__((__packed__)) xf_unroute_port_msg_t; diff --git a/hifi/xaf/hifi-dpf/include/xf-plugin.h b/hifi/xaf/hifi-dpf/include/xf-plugin.h deleted file mode 100644 index 5805e9ff..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-plugin.h - * - * Xtensa audio processing framework - plugin infrastructure. - * - ******************************************************************************/ - -#ifdef __XF_H -#error "xf-plugin.h cannot be used together with xf.h" -#endif - -#define __XF_H - -/******************************************************************************* - * Plugin debugging interface - ******************************************************************************/ - -/* ...platform-specific HAL */ -#include "xf-hal.h" -#ifdef XAF_ENABLE_NON_HIKEY -//#define XF_TRACE 1 -#define XF_DEBUG 1 -#endif - -/* ...debugging facilities */ -#include "xf-debug.h" diff --git a/hifi/xaf/hifi-dpf/include/xf-proxy.h b/hifi/xaf/hifi-dpf/include/xf-proxy.h deleted file mode 100644 index 0260749c..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-proxy.h +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-proxy.h - * - * Proxy commmand/response messages - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-proxy.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ -#ifdef XAF_ENABLE_NON_HIKEY -/* ...command/response message */ -typedef struct xf_proxy_message -{ - /* ...session ID */ - uint32_t session_id; - - /* ...proxy API command/reponse code */ - uint32_t opcode; - - /* ...length of attached buffer */ - uint32_t length; - - /* ...physical address of message buffer */ - uint64_t address; - uint64_t v_address; - -} __attribute__((__packed__)) xf_proxy_message_t; -#else -/* ...command/response message */ -typedef struct xf_proxy_message -{ - /* ...session ID */ - uint32_t session_id; - - /* ...proxy API command/reponse code */ - uint32_t opcode; - - /* ...length of attached buffer */ - uint32_t length; - - /* ...physical address of message buffer */ - uint64_t address; - uint64_t v_address; - -} __attribute__((__packed__)) xf_proxy_message_t; -#endif -/******************************************************************************* - * Ring buffer support - ******************************************************************************/ - -/* ...total length of shared memory queue (for commands and responses) */ -#define XF_PROXY_MESSAGE_QUEUE_LENGTH (1 << 8) - -/* ...index mask */ -#define XF_PROXY_MESSAGE_QUEUE_MASK 0xFF - -/* ...ring-buffer index */ -#define __XF_QUEUE_IDX(idx, counter) \ - (((idx) & XF_PROXY_MESSAGE_QUEUE_MASK) | ((counter) << 16)) - -/* ...retrieve ring-buffer index */ -#define XF_QUEUE_IDX(idx) \ - ((idx) & XF_PROXY_MESSAGE_QUEUE_MASK) - -/* ...increment ring-buffer index */ -#define XF_QUEUE_ADVANCE_IDX(idx) \ - (((idx) + 0x10001) & (0xFFFF0000 | XF_PROXY_MESSAGE_QUEUE_MASK)) - -/* ...test if ring buffer is empty */ -#define XF_QUEUE_EMPTY(read, write) \ - ((read) == (write)) - -/* ...test if ring buffer is full */ -#define XF_QUEUE_FULL(read, write) \ - ((write) == (read) + (XF_PROXY_MESSAGE_QUEUE_LENGTH << 16)) diff --git a/hifi/xaf/hifi-dpf/include/xf-sched.h b/hifi/xaf/hifi-dpf/include/xf-sched.h deleted file mode 100644 index 3c04436c..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-sched.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-sched.h - * - * Non-preemptive earliest-deadline-first scheduler - * - ******************************************************************************/ - -#ifndef __XF_SCHED_H -#define __XF_SCHED_H - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...scheduler data */ -typedef rb_tree_t xf_sched_t; - -/* ...scheduling item */ -typedef rb_node_t xf_task_t; - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...retrieve timestamp from task handle */ -static inline u32 xf_task_timestamp(xf_task_t *t) -{ - /* ...wipe out last bit of "color" */ - return (((rb_node_t *)t)->color & ~1); -} - -/* ...set task decoding timestamp */ -static inline u32 xf_task_timestamp_set(xf_task_t *t, u32 ts) -{ - /* ...technically, wiping out last bit of timestamp is not needed */ - return (((rb_node_t *)t)->color = ts); -} - -/* ...compare two timestamps with respect to wrap-around */ -static inline int xf_timestamp_before(u32 t0, u32 t1) -{ - /* ...distance between active items is never high */ - return ((s32)(t0 - t1) < 0); -} - -/* ...current scheduler timestamp */ -static inline u32 xf_sched_timestamp(xf_sched_t *sched) -{ - /* ...don't quite care about last bit */ - return ((rb_tree_t *)sched)->root.color; -} - -/* ...set scheduler timestamp */ -static inline u32 xf_sched_timestamp_set(xf_sched_t *sched, u32 ts) -{ - /* ...wipe out last bit (black color is 0) */ - return (((rb_tree_t *)sched)->root.color = ts & ~0x1); -} - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...place message into scheduler queue */ -extern void xf_sched_put(xf_sched_t *sched, xf_task_t *t, u32 ts); - -/* ...get first item from the scheduler */ -extern xf_task_t * xf_sched_get(xf_sched_t *sched); - -/* ...cancel task execution */ -extern void xf_sched_cancel(xf_sched_t *sched, xf_task_t *t); - -/* ...initialize scheduler */ -extern void xf_sched_init(xf_sched_t *sched); - -#endif /* __XF_SCHED_H */ diff --git a/hifi/xaf/hifi-dpf/include/xf-timebase.h b/hifi/xaf/hifi-dpf/include/xf-timebase.h deleted file mode 100644 index 7b27d580..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-timebase.h +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-timebase.h - * - * Common timebase for deadline-driven scheduler - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-timebase.h mustn't be included directly" -#endif - -/******************************************************************************* - * Timebase for deadline-driven scheduler - ******************************************************************************/ -#ifdef XAF_ENABLE_NON_HIKEY -/* ...set internal scheduler frequency as a LCM of all supported sample rates; - * it is in general not a problem to have large number here, however it should - * be noted that maximal-size audio-buffer that we handle, when expressed in - * ticks of this virtual frequency, must not exceed 2**31 (for otherwise - * scheduler timestamp comparison function will misbehave). - */ -#define XF_TIMEBASE_FREQ (4 * 3 * 56448000U) -/* ...add paranoic check considering maximal audio-buffer duration as 0.1 sec */ -C_BUG((u32)(XF_TIMEBASE_FREQ / 10) >= (1 << 31)); -#else -/* ...set internal scheduler frequency as a LCM of all supported sample rates */ -#define XF_TIMEBASE_FREQ 56448000U -#endif -/* ...supported sampling rates */ -C_BUG(XF_TIMEBASE_FREQ % 4000); -C_BUG(XF_TIMEBASE_FREQ % 8000); -C_BUG(XF_TIMEBASE_FREQ % 11025); -C_BUG(XF_TIMEBASE_FREQ % 12000); -C_BUG(XF_TIMEBASE_FREQ % 16000); -C_BUG(XF_TIMEBASE_FREQ % 22050); -C_BUG(XF_TIMEBASE_FREQ % 24000); -C_BUG(XF_TIMEBASE_FREQ % 32000); -C_BUG(XF_TIMEBASE_FREQ % 44100); -C_BUG(XF_TIMEBASE_FREQ % 48000); -C_BUG(XF_TIMEBASE_FREQ % 64000); -C_BUG(XF_TIMEBASE_FREQ % 88200); -C_BUG(XF_TIMEBASE_FREQ % 96000); -C_BUG(XF_TIMEBASE_FREQ % 128000); -C_BUG(XF_TIMEBASE_FREQ % 176400); -C_BUG(XF_TIMEBASE_FREQ % 192000); - -/* ...calculate upsampling factor for given sample rate */ -static inline u32 xf_timebase_factor(u32 sample_rate) -{ - /* ...probably we can tolerate single division */ - switch(sample_rate) - { - case 4000: - return XF_TIMEBASE_FREQ / 4000; - case 8000: - return XF_TIMEBASE_FREQ / 8000; - case 11025: - return XF_TIMEBASE_FREQ / 11025; - case 12000: - return XF_TIMEBASE_FREQ / 11025; - case 16000: - return XF_TIMEBASE_FREQ / 16000; - case 22050: - return XF_TIMEBASE_FREQ / 22050; - case 24000: - return XF_TIMEBASE_FREQ / 24000; - case 32000: - return XF_TIMEBASE_FREQ / 32000; - case 44100: - return XF_TIMEBASE_FREQ / 44100; - case 48000: - return XF_TIMEBASE_FREQ / 48000; - case 64000: - return XF_TIMEBASE_FREQ / 64000; - case 88200: - return XF_TIMEBASE_FREQ / 88200; - case 96000: - return XF_TIMEBASE_FREQ / 96000; - case 128000: - return XF_TIMEBASE_FREQ / 128000; - case 176400: - return XF_TIMEBASE_FREQ / 176400; - case 192000: - return XF_TIMEBASE_FREQ / 192000; - default: - return 0; - } -} - -/* ...core timebase */ -static inline u32 xf_core_timebase(u32 core) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - - /* ...get local scheduler timebase */ - return xf_sched_timestamp(&cd->sched); -} - -/* ...compare timestamps */ -static inline int xf_time_after(u32 a, u32 b) -{ - return ((s32)(a - b) > 0); -} - -/* ...compare timstamps */ -static inline int xf_time_before(u32 a, u32 b) -{ - return ((s32)(a - b) < 0); -} - diff --git a/hifi/xaf/hifi-dpf/include/xf-trace.h b/hifi/xaf/hifi-dpf/include/xf-trace.h deleted file mode 100644 index 97bb2905..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-trace.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-debug.h - * - * Debugging interface for Xtensa Audio DSP codec server - * - *******************************************************************************/ - -#ifndef __XF_H -#error "xf-debug.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -#if XF_TRACE - -/* ...trace data definition */ -typedef struct xf_trace_data -{ - /* ...current write position in tracing buffer */ - char *p; - - /* ...threshold position for buffer submission */ - char *end; - -#if XF_TRACE_REMOTE - /* ...beginning of non-commited internal tracing buffer */ - char *start; - - /* ...message queue */ - xf_msg_queue_t queue; -#endif - -} xf_trace_data_t; - -#else - -/* ...stub for disabled tracing */ -typedef u32 xf_trace_data_t[0]; - -#endif /* XF_TRACE */ - -/******************************************************************************* - * Internal API functions - ******************************************************************************/ - -#if XF_TRACE_REMOTE -/* ...submit buffer for tracing */ -extern void xf_trace_submit(u32 core, xf_message_t *m); - -/* ...flush current buffer */ -extern void xf_trace_flush(u32 core, xf_message_t *m); - -#else - -#define xf_trace_submit(core, m) (void)0 -#define xf_trace_flush(core, m) (void)0 - -#endif /* XF_TRACE_REMOTE */ diff --git a/hifi/xaf/hifi-dpf/include/xf.h b/hifi/xaf/hifi-dpf/include/xf.h deleted file mode 100644 index f124d8ca..00000000 --- a/hifi/xaf/hifi-dpf/include/xf.h +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf.h - * - * Xtensa audio processing framework. Main header - * - ******************************************************************************/ - -#ifdef __XF_H -#error "xf.h included more than once" -#endif - -#define __XF_H - -/******************************************************************************* - * Global configuration parameters (changing is to be done carefully) - ******************************************************************************/ - -/* ...allocate 6 bits for client number per core */ -#define XF_CFG_MAX_CLIENTS (1 << 6) - -/* ...allocate 2 bits for core id */ -#define XF_CFG_MAX_CORES (1 << 2) - -/* ...allocate 4 bits for maximal number of input/output ports per component */ -#define XF_CFG_MAX_PORTS (1 << 4) - -/* ...allocate 6 bits for opcode type */ -#define XF_CFG_MAX_CODES (1 << 6) - -/******************************************************************************* - * Common runtime framework - ******************************************************************************/ -#ifndef XAF_ENABLE_NON_HIKEY -#include "cpu_c.h" - -#include "dsp_driver_ipc.h" - -#include "dsp_debug.h" - -#include "dsp_memory_config.h" - -#include "dsp_driver_mailbox.h" - -#include "dsp_pcm_gain.h" - -#endif -/* ...target configuration */ -#include "xf-config.h" - -/* ...platform run-time */ -#include "xf-runtime.h" - -/* ...debugging facility */ -#include "xf-debug.h" - -/* ...generic memory allocator */ -#include "xf-mm.h" - -/* ...standard opcodes */ -#include "xf-opcode.h" - -/* ...proxy definitions (shared messages - tbd) */ -#include "xf-proxy.h" - -/* ...message API */ -#include "xf-msg.h" - -/* ...tracer data */ -#include "xf-trace.h" - -/* ...I/O ports */ -#include "xf-io.h" - -/* ...scheduler definition */ -#include "xf-sched.h" - -/* ...component definition */ -#include "xf-component.h" - -/* ...core data */ -#include "xf-core.h" - -/* ...system abstractions */ -#include "xf-sys.h" - -/* ...memory management */ -#include "xf-mem.h" - -/* ...common timebase */ -#include "xf-timebase.h" diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/arch_hifi330.S b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/arch_hifi330.S deleted file mode 100644 index 6d1eb7e7..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/arch_hifi330.S +++ /dev/null @@ -1,468 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/****************************************************************************** - arch_hifi330.S -******************************************************************************/ - -#include <xtensa/coreasm.h> -#include <xtensa/simcall.h> -#include <xtensa/corebits.h> -#include <xtensa/config/system.h> -#include <xtensa/config/core.h> -#include "arch_hifi330.h" - - .global OSStartHighRdy - .global OSTaskSwHook - .global g_pstVosTCBHighRdy - .global g_bVosRunning - -// .data - .section .dram0.data, "aw" - .type OSIntCtxSw_Occur,@object -OSIntCtxSw_Occur: - .byte 0 - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .align 4 - .globl VOSStartHighRdy - .type VOSStartHighRdy,@function - .align 4 -/***************************************************************************** - VOSStartHighRdy -*****************************************************************************/ -VOSStartHighRdy: - ENTRY(16) - - /*OSIntCtxSw_Occur*/ - movi a2, OSIntCtxSw_Occur - movi a3, 0 - s8i a3, a2, 0 - - movi a2, g_bVosRunning - movi a3, 1 - s8i a3, a2, 0 - -#if 0 - /*OS_TaskSwHook */ - movi a2, OS_TaskSwHook - callx4 a2 -#endif - call0 OS_TaskSwitch - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl VOSCtxSw - .type VOSCtxSw,@function - .align 4 -/***************************************************************************** - OSCtxSw -*****************************************************************************/ -VOSCtxSw: - entry sp, XT_SOL_FRMSZ - rsr a2, PS - s32i a0, sp, XT_SOL_PC - s32i a2, sp, XT_SOL_PS - movi a2, g_pstVosTCBCur - movi a3, 0 - l32i a2, a2, 0 - s32i a3, sp, XT_SOL_EXIT - s32i sp, a2, OSTCBStkPtr /* g_pstVosTCBCur->OSTCBStkPtr = SP; */ - - call4 xthal_window_spill -#if 0 - /*OS_TaskSwHook */ - movi a2, OS_TaskSwHook - callx4 a2 -#endif - - /* CPENABLE, co-processor state. */ - movi a3, g_pstVosTCBCur - l32i a3, a3, 0 - l32i a2, a3, OSTCBStkBottom - movi a3, 0 - - wsr a3, CPENABLE /* disable all co-processors */ - s8i a3, a2, XT_CPENABLE /* cp_state->cpenable = 0; */ - - - call0 OS_TaskSwitch - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl VOSIntCtxSw - .type VOSIntCtxSw,@function - .align 4 -/***************************************************************************** - OSIntCtxSw -*****************************************************************************/ -VOSIntCtxSw: - ENTRY(16) -#if 0 - /*OS_TaskSwHook */ - movi a2, OS_TaskSwHook - callx4 a2 -#endif - - /*CPENABLE task co-processor, CPENABLE. */ - movi a3, g_pstVosTCBCur - l32i a3, a3, 0 - l32i a2, a3, OSTCBStkBottom - rsr a3, CPENABLE - s8i a3, a2, XT_CPENABLE - movi a3, 0 - wsr a3, CPENABLE - - movi a2, OSIntCtxSw_Occur - movi a3, 1 - s8i a3, a2, 0 - - - RET(16) - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OSCPUSaveSR - .type OSCPUSaveSR,@function - .align 4 -/***************************************************************************** - OSCPUSaveSR -*****************************************************************************/ -OSCPUSaveSR: - entry a1,32 - rsil a2,15 - esync - retw - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OSCPURestoreSR - .type OSCPURestoreSR,@function - .align 4 -/***************************************************************************** - OSCPURestoreSR -*****************************************************************************/ -OSCPURestoreSR: - entry a1,32 - wsr.ps a2 - esync - retw - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_TaskSwitch - .type OS_TaskSwitch,@function - .align 4 -/***************************************************************************** - OS_TaskSwitch -*****************************************************************************/ -OS_TaskSwitch: - - /*1) - g_ucVosPrioCur = g_ucVosPrioHighRdy; - g_pstVosTCBCur = g_pstVosTCBHighRdy; - SP = g_pstVosTCBHighRdy->OSTCBStkPtr; - */ - movi a2, g_ucVosPrioHighRdy - movi a3, g_ucVosPrioCur - l8ui a2, a2, 0 - movi a4, g_pstVosTCBHighRdy - s8i a2, a3, 0 - movi a2, g_pstVosTCBCur - l32i a3, a4, 0 - l32i sp, a3, OSTCBStkPtr - s32i a3, a2, 0 - - - l32i a2, sp, XT_STK_EXIT - bnez a2, .L_in_int - - - l32i a3, sp, XT_SOL_PS - l32i a0, sp, XT_SOL_PC - - rsync - - wsr a3, PS - retw - -.L_in_int: - /* co-processor CPENABLE*/ - movi a3, g_pstVosTCBCur - l32i a3, a3, 0 - l32i a2, a3, OSTCBStkBottom - l8ui a3, a2, XT_CPENABLE - wsr a3, CPENABLE - - - call0 OS_ContextRestore - rsync - - l32i a0, sp, XT_STK_EXIT - ret - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl OS_ContextSave - .type OS_ContextSave,@function - .align 4 -/***************************************************************************** - OS_ContextSave -*****************************************************************************/ -OS_ContextSave: - - /*1): - A2 - A3 - A4 - A5 - A6 - A7 - A8 - A9 - A10 - A11 - SAR,LBENG,LEND,LCOUNT*/ - s32i a2, sp, XT_STK_A2 - s32i a3, sp, XT_STK_A3 - s32i a4, sp, XT_STK_A4 - s32i a5, sp, XT_STK_A5 - s32i a6, sp, XT_STK_A6 - s32i a7, sp, XT_STK_A7 - s32i a8, sp, XT_STK_A8 - s32i a9, sp, XT_STK_A9 - s32i a10, sp, XT_STK_A10 - s32i a11, sp, XT_STK_A11 - s32i a14, sp, XT_STK_A14 - s32i a15, sp, XT_STK_A15 - - - rsr a3, SAR - s32i a3, sp, XT_STK_SAR - - rsr a3, LBEG - s32i a3, sp, XT_STK_LBEG - rsr a3, LEND - s32i a3, sp, XT_STK_LEND - rsr a3, LCOUNT - s32i a3, sp, XT_STK_LCOUNT - - /*2)*/ - mov a9, a0 - s32i a12, sp, XT_STK_TMP+0 - s32i a13, sp, XT_STK_TMP+4 - s32i a9, sp, XT_STK_TMP+8 - l32i a12, sp, XT_STK_A12 - l32i a13, sp, XT_STK_A13 - l32i a9, sp, XT_STK_A9 - addi sp, sp, XT_STK_FRMSZ - call0 xthal_window_spill_nw - addi sp, sp, -XT_STK_FRMSZ - l32i a12, sp, XT_STK_TMP+0 - l32i a13, sp, XT_STK_TMP+4 - l32i a9, sp, XT_STK_TMP+8 - - addi a2, sp, XT_STK_EXTRA - call0 xthal_save_extra_nw - - mov a0, a9 - ret - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_ContextRestore - .type OS_ContextRestore,@function - .align 4 -/***************************************************************************** - OS_ContextRestore -*****************************************************************************/ -OS_ContextRestore: - /* - 1) xthal_restore_extra_nw*/ - mov a13, a0 - addi a2, sp, XT_STK_EXTRA - call0 xthal_restore_extra_nw - mov a0, a13 - - /*2): - LBEG - LEND - LCOUNT - A2 - SAR - A3 - A4 - A5 - A6 - A7 - A8 - A9 - A10 - A11 - A12 - A13 - A14 - A15*/ - l32i a2, sp, XT_STK_LBEG - l32i a3, sp, XT_STK_LEND - wsr a2, LBEG - l32i a2, sp, XT_STK_LCOUNT - wsr a3, LEND - wsr a2, LCOUNT - - l32i a3, sp, XT_STK_SAR - l32i a2, sp, XT_STK_A2 - wsr a3, SAR - l32i a3, sp, XT_STK_A3 - l32i a4, sp, XT_STK_A4 - l32i a5, sp, XT_STK_A5 - l32i a6, sp, XT_STK_A6 - l32i a7, sp, XT_STK_A7 - l32i a8, sp, XT_STK_A8 - l32i a9, sp, XT_STK_A9 - l32i a10, sp, XT_STK_A10 - l32i a11, sp, XT_STK_A11 - - l32i a12, sp, XT_STK_A12 - l32i a13, sp, XT_STK_A13 - l32i a14, sp, XT_STK_A14 - l32i a15, sp, XT_STK_A15 - - ret - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl OS_IntEnter - .type OS_IntEnter,@function - .align 4 -OS_IntEnter: - - /* Save a12-13 in the stack frame as required by _xt_context_save. */ - s32i a12, sp, XT_STK_A12 - s32i a13, sp, XT_STK_A13 - - /* Save return address in a safe place (free a0). */ - mov a12, a0 - - /* Save the rest of the interrupted context (preserves A12-13). */ - call0 OS_ContextSave - - /* - Save interrupted task's SP in TCB only if not nesting. - Manage nesting directly rather than call the generic OSIntEnter() - (in windowed ABI we can't call a C function here anyway because PS.EXCM is still set). - */ - movi a2, g_bVosRunning - movi a3, g_ucVosIntNesting - l8ui a2, a2, 0 /* if (g_bVosRunning == OS_TRUE) { */ - beqz a2, 2f - l8ui a2, a3, 0 /* if (g_ucVosIntNesting == 0) { */ - bnez a2, 1f - movi a4, g_pstVosTCBCur - l32i a4, a4, 0 - s32i sp, a4, OSTCBStkPtr /* g_pstVosTCBCur->OSTCBStkPtr = SP; */ -1: /* } */ - addi a2, a2, 1 /* if (g_ucVosIntNesting < 255u) { */ - bgeui a2, 256, 2f /* g_ucVosIntNesting++; */ - s8i a2, a3, 0 /* } */ -2: /* } */ - - /* Retrieve the return address and return to interrupt handler. */ - mov a0, a12 - ret - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl OS_IntExit - .type OS_IntExit,@function - .align 4 -OS_IntExit: -#if 0 - /* Call VOSIntExit() to deal with nesting and call the scheduler. */ - movi a2, VOSIntExit - - rsil a0, XCHAL_EXCM_LEVEL /* enter critical section */ - callx4 a2 /* VOSIntExit() */ -#endif - /* Context-switch deferred from OSIntCtxSw(). Still in critical section. */ - movi a2, OSIntCtxSw_Occur - l8ui a3, a2, 0 - beqz a3, 1f /* if (OSIntCtxSw_Occur) { */ - movi a3, 0 /* OSIntCtxSw_Occur = false; */ - s8i a3, a2, 0 - call0 OS_TaskSwitch /* tail-call dispatcher; */ - /* Never returns here. */ /* } */ -1: - - /* - We come here only if there was no context switch, that is if this - is a nested interrupt or the interrupted task was not preempted. - We are still on the same stack so there's no need to load the SP. - */ - - /* Restore full context from interrupt stack frame and return to exit dispatcher. */ - call0 OS_ContextRestore - - /* - Must return via the exit dispatcher corresponding to the entrypoint from which - this was called. Interruptee's A0, A1, PS, PC are restored and the interrupt - stack frame is deallocated in the exit dispatcher. - */ - l32i a0, sp, XT_STK_EXIT - ret - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .globl OS_GetTaskCoprocState - .type OS_GetTaskCoprocState,@function - .align 4 -OS_GetTaskCoprocState: - - movi a2, g_bVosRunning - movi a3, g_ucVosIntNesting - l8ui a2, a2, 0 - l8ui a3, a3, 0 - beqz a2, 1f - bnez a3, 1f - movi a15, g_pstVosTCBCur - l32i a15, a15, 0 - beqz a15, 2f - l32i a15, a15, OSTCBStkBottom - ret - -1: movi a15, 0 -2: ret - .end literal_prefix - - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/cpu_c.c b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/cpu_c.c deleted file mode 100644 index 12ce8b71..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/cpu_c.c +++ /dev/null @@ -1,152 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - - -#include "cpu_c.h" -#include <xtensa/config/specreg.h> -#include <xtensa/config/core.h> -#include <xtensa/simcall.h> -#include "arch_hifi330.h" - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif - -/*lint -e838 -e835 -e750 -e529 -e533 -e40*/ - -//#define DSP_TRACES_TO_MEM_SIZE (0x800) - -void *g_pfVosHookFuncTable[OS_HOOK_TYPE_BUTT]; - -void *g_pfVosIntrFuncTable[OS_INTR_CONNECT_BUTT]; - -//unsigned int g_uwSoftIntInfo = 0; - -/* Interrupt nesting level */ -unsigned char g_ucVosIntNesting; - -/* Priority of current task */ -unsigned char g_ucVosPrioCur; - -/* Priority of highest priority task */ -unsigned char g_ucVosPrioHighRdy; - -/* Flag indicating that kernel is running */ -unsigned short g_bVosRunning; - -/* Pointer to highest priority TCB R-to-R */ -unsigned int *g_pstVosTCBHighRdy; - -/* Pointer to currently running TCB*/ -unsigned int *g_pstVosTCBCur; - -#define _XTSTR(x) #x -#define XTSTR(x) _XTSTR(x) - -void OS_EnterIntHook(unsigned int uhwIntrNo) -{ - INTR_HOOK_FUN_TYPE pfIntrHook = (INTR_HOOK_FUN_TYPE)g_pfVosHookFuncTable[OS_HOOK_TYPE_ENTER_INTR];/*lint !e611*/ - - if (0 != pfIntrHook) - { - pfIntrHook(uhwIntrNo); - } -} - -void OS_ExitIntHook(unsigned int uhwIntrNo) -{ - INTR_HOOK_FUN_TYPE pfIntrHook = (INTR_HOOK_FUN_TYPE)g_pfVosHookFuncTable[OS_HOOK_TYPE_EXIT_INTR];/*lint !e611*/ - - if (0 != pfIntrHook) - { - pfIntrHook(uhwIntrNo); - } -} - -void OS_UserexecHandler(unsigned int uwExecCauseNo, unsigned int psAddr) -{ - VOS_EXCEPTION_HOOK_FUNC pfIntrHook = (VOS_EXCEPTION_HOOK_FUNC)g_pfVosHookFuncTable[OS_HOOK_TYPE_EXCEPTION];/*lint !e611*/ - - if (0 != pfIntrHook) - { - pfIntrHook(uwExecCauseNo); - } - else - { - extern void OS_Panic(void); - OS_Panic(); - } -} - -void OS_InterruptHandler(unsigned int uhwIntrNo) -{ - HOOK_FUN_TYPE pfIntrHook = (HOOK_FUN_TYPE)g_pfVosIntrFuncTable[uhwIntrNo]; - - if (0 != pfIntrHook) - //pfIntrHook(); - pfIntrHook(0); -} - -void OS_NmiHook(unsigned int uwExecCauseNo, unsigned int psAddr) -{ - HOOK_FUN_TYPE pfNmiHook = (HOOK_FUN_TYPE)g_pfVosHookFuncTable[OS_HOOK_TYPE_NMI];/*lint !e611*/ - - if (0 != pfNmiHook) - { - //pfNmiHook(); - pfNmiHook(0); - } - - //wait for hifi reset - UCOM_SET_WFI_NMI(5); -} - -void VOS_ConnectInterrupt(unsigned int uwIntrNo, HOOK_FUN_TYPE pfnInterruptHook) -{ - g_pfVosIntrFuncTable[uwIntrNo] = (void *)pfnInterruptHook;/*lint !e611*/ -} - -void VOS_EnableInterrupt(unsigned int uwIntNo) -{ - unsigned int uwBitEnable; - - uwBitEnable = xthal_get_intenable(); - xthal_set_intenable(uwBitEnable | (((unsigned int)1) << uwIntNo )); - -} -void VOS_DisableInterrupt(unsigned int uwIntNo) -{ - unsigned int uwBitEnable; - - uwBitEnable = xthal_get_intenable(); - xthal_set_intenable(uwBitEnable | (((unsigned int)0) << uwIntNo )); - -} - -#ifdef __cplusplus - #if __cplusplus - } - #endif -#endif - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_comm.c b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_comm.c deleted file mode 100644 index 290ca9dd..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_comm.c +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include "dsp_comm.h" - -void dsp_memcpy(void *d, void *s, unsigned int size) -{ - unsigned char *dest = (unsigned char*)d; - unsigned char *src = (unsigned char*)s; - - if (s == d) { - return; - } else if (src > dest) { - for (; dest < ((unsigned char*)d + size); dest++) { - *dest = *src; - src++; - } - } else { - src = src + (size - 1); - for (dest = dest + (size - 1); dest >= (unsigned char*)d; dest--) { - *dest = *src; - src--; - } - } -} - - -void dsp_memset(void *d, unsigned char ucData, unsigned int size) -{ - unsigned int i; - unsigned char *dest = (unsigned char*)d; - - for(i = 0; i < size; i++) - *dest++ = ucData; -} -int division(int a, int b) -{ - const int bits_in_word_m1 = (int)(sizeof(int) * 8) - 1; - int s_a = a >> bits_in_word_m1; /* s_a = a < 0 ? -1 : 0 */ - int s_b = b >> bits_in_word_m1; /* s_b = b < 0 ? -1 : 0 */ - a = (a ^ s_a) - s_a; /* negate if s_a == -1 */ - b = (b ^ s_b) - s_b; /* negate if s_b == -1 */ - s_a ^= s_b; /* sign of quotient */ - /* - * On CPUs without unsigned hardware division support, - * this calls __udivsi3 (notice the cast to su_int). - * On CPUs with unsigned hardware division support, - * this uses the unsigned division instruction. - */ - return ((int)a/(int)b ^ s_a) - s_a; /* negate if s_a == -1 */ - -} - - - - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_debug.c b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_debug.c deleted file mode 100644 index a74308e4..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/dsp_debug.c +++ /dev/null @@ -1,468 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include <stdarg.h> -#include <stdlib.h> -#include "dsp_debug.h" -#include "dsp_memory_config.h" -#include "dsp_driver_mailbox.h" -#include "dsp_comm.h" -#include "dsp_pcm_gain.h" -extern int g_pcm_gain; -extern int MsgFlag; -extern int InpBuf[HOLD_BUF_SIZE]; // assumes 32 bit samples. -extern int OutBuf[HOLD_BUF_SIZE]; // assumes 32 bit samples. - -static int hex2asc(int n) -{ - n &= 15; - if(n > 9){ - return ('a' - 10) + n; - } else { - return '0' + n; - } -} - -static void xputs(const char *s, void (*xputc)(unsigned n, void *cookie), void *cookie) -{ - while (*s) { - xputc(*s++, cookie); - } -} - -void __xprintf(const char *fmt, va_list ap,void (*xputc)(unsigned n, void *cookie), void *cookie) -{ - char scratch[32]; - for(;;){ - switch(*fmt){ - case 0: - va_end(ap); - return; - case '%': - switch(fmt[1]) { - case 'c': { - unsigned n = va_arg(ap, unsigned); - xputc(n, cookie); - fmt += 2; - continue; - } - case 'h': { - unsigned n = va_arg(ap, unsigned); - xputc(hex2asc(n >> 12), cookie); - xputc(hex2asc(n >> 8), cookie); - xputc(hex2asc(n >> 4), cookie); - xputc(hex2asc(n >> 0), cookie); - fmt += 2; - continue; - } - case 'b': { - unsigned n = va_arg(ap, unsigned); - xputc(hex2asc(n >> 4), cookie); - xputc(hex2asc(n >> 0), cookie); - fmt += 2; - continue; - } - case 'p': - case 'X': - case 'x': { - unsigned n = va_arg(ap, unsigned); - char *p = scratch + 15; - *p = 0; - do { - *--p = hex2asc(n); - n = n >> 4; - } while(n != 0); - while(p > (scratch + 7)) *--p = '0'; - xputs(p, xputc, cookie); - fmt += 2; - continue; - } - case 'd': { - int n = va_arg(ap, int); - char *p = scratch + 15; - *p = 0; - if(n < 0) { - xputc('-', cookie); - n = -n; - } - do { - *--p = (n % 10) + '0'; - n /= 10; - } while(n != 0); - xputs(p, xputc, cookie); - fmt += 2; - continue; - } - - case 'f': { - double fnum = va_arg(ap, double); - unsigned long long ipart, fpart; - int i=4; - char *p = scratch + 31; - *p = '\0'; - - if(fnum < 0.0) - { - xputc('-', cookie); - fnum = -fnum; - } - ipart = (unsigned long long)fnum; - fpart = ((fnum-ipart)*10000); //10^i = 10000 - - while(i>0) - { - *--p = (fpart % 10) + '0'; - fpart /= 10; - i--; - } - *--p = '.'; - while(ipart > 0) - { - *--p = (ipart % 10) + '0'; - ipart /= 10; - } - - xputs(p, xputc, cookie); - fmt += 2; - continue; - } - - case 'u': { - unsigned n = va_arg(ap, unsigned); - char *p = scratch + 15; - *p = 0; - do { - *--p = (n % 10) + '0'; - n /= 10; - } while(n != 0); - xputs(p, xputc, cookie); - fmt += 2; - continue; - } - case 's': { - char *s = (char *)va_arg(ap, char*); - if(s == 0) s = "(null)"; - xputs(s, xputc, cookie); - fmt += 2; - continue; - } - case 'l': { - if (fmt[2] == 'x') { - unsigned long long n = va_arg(ap, unsigned long long); - char *p = scratch + 23; - *p = 0; - do { - *--p = hex2asc((int)n); - n = n >> 4; - } while(n != 0); - while(p > (scratch + 7)) *--p = '0'; - xputs(p, xputc, cookie); - fmt += 3; - continue; - } - } - } - xputc(*fmt++, cookie); - break; - case '\n': - xputc('\r', cookie); - default: - xputc(*fmt++, cookie); - } - } -} - -static char* log_to_mem_head = 0; -void dsp_debug_init() -{ - log_to_mem_head = (char *)(*((unsigned int *)DRV_DSP_UART_TO_MEM_CUR_ADDR) + DRV_DSP_UART_TO_MEM); - -} - -static void log_write_to_mem(const char c_data) -{ - *log_to_mem_head = c_data; - - log_to_mem_head++; - if ((unsigned int)log_to_mem_head >= (DRV_DSP_UART_TO_MEM + DRV_DSP_UART_TO_MEM_SIZE - 1)) - log_to_mem_head = (char *)DRV_DSP_UART_TO_MEM + DRV_DSP_UART_TO_MEM_RESERVE_SIZE; - - *((unsigned int *)DRV_DSP_UART_TO_MEM_CUR_ADDR) = (unsigned int)log_to_mem_head - DRV_DSP_UART_TO_MEM; -} - - -static void print_char(const char c_data) -{ - if (c_data == '\n') - log_write_to_mem('\r'); - log_write_to_mem(c_data); -} - -typedef void (*xputc_type)(unsigned n, void *cookie); - -void print_log(const char *fmt, ...) -{ - va_list args; -va_start(args, fmt); - __xprintf(fmt, args, (xputc_type)print_char, 0); - va_end(args); -} -#ifdef HIKEY_XAF_IPC_COMMENT_OUT -#define ISSPACE(c) (c == ' ' || c == 0x09 || c == 0x0A || c == 0x0D || c == 0) - -char* dsp_om_trim_zero(char* str) -{ - char *str_begin = 0; - char *str_end = 0; - - if (!str) - return 0; - - str_begin = str; - str_end = str + strlen(str); - - while (str_begin < str_end) { - if (ISSPACE(*str_begin)) { - *str_begin = 0; - str_begin++; - } else { - break; - } - } - while (str_begin < str_end) { - if (ISSPACE(*str_end)) { - *str_end = 0; - str_end--; - } else { - break; - } - } - - return str_begin; -} - -char * dsp_om_split_str(char* str, char** split_str) -{ - char *str_begin = 0; - char *str_end = 0; - - if ((!str) || (!split_str)) { - DSP_LOGE("input param is null\n"); - return str; - } - - str_end = str + strlen(str); - str_begin = dsp_om_trim_zero(str); - - if (str_begin == str_end) { - DSP_LOGE("input str all space\n"); - return 0; - } - - *split_str = dsp_om_trim_zero(strchr(str_begin, ' ')); - - return str_begin; -} - -#ifdef GJB_CHANGE -void send_msg_data_to_ap() -{ - - struct hikey_msg_with_content hikey_msg; - DSP_LOGE("%s\n", __func__); - hikey_msg.msg_info.msg_id=HIKEY_AUDIO_DSP_AP_OM_CMD; - hikey_msg.msg_info.msg_len=HIKEY_AP_DSP_MSG_MAX_LEN; - strncpy(hikey_msg.msg_info.msg_content,"pcm_gain",HIKEY_AP_DSP_MSG_MAX_LEN); - dsp_mailbox_write(&hikey_msg); - DSP_LOGE("Exit %s\n", __func__); -} - -void send_pcm_data_to_ap() -{ - struct hikey_ap_dsp_msg_body msg_info; - DSP_LOGE("Enter %s\n", __func__); - msg_info.msg_id = ID_XAF_DSP_TO_AP; - msg_info.msg_len = sizeof(msg_info); - msg_info.xf_dsp_msg.id= 0; - msg_info.xf_dsp_msg.opcode = 0xc; - msg_info.xf_dsp_msg.length = 0x400; - msg_info.xf_dsp_msg.address = 0x8B432000; - dsp_mailbox_write(&msg_info); - DSP_LOGE("Exit %s\n", __func__); -} -#else -void send_msg_data_to_ap() -{ - xf_proxy_message_t hikey_msg; - DSP_LOGE("%s\n", __func__); - hikey_msg.id=HIKEY_AUDIO_DSP_AP_OM_CMD; - hikey_msg.length=HIKEY_AP_DSP_MSG_MAX_LEN; - strncpy(hikey_msg.address,"pcm_gain",HIKEY_AP_DSP_MSG_MAX_LEN); - dsp_mailbox_write(&hikey_msg); - DSP_LOGE("Exit %s\n", __func__); -} - -void send_pcm_data_to_ap() -{ - xf_proxy_message_t msg_info; - DSP_LOGE("Enter %s\n", __func__); - msg_info.id = ID_XAF_DSP_TO_AP; - msg_info.opcode = 0xc; - msg_info.length = 0x400; - msg_info.address = 0x8B432000; - dsp_mailbox_write(&msg_info); - DSP_LOGE("Exit %s\n", __func__); -} -#endif -static void dsp_om_read_mem(char *str) -{ - unsigned int addr = 0; - unsigned int val = 0; - if (!str) { - DSP_LOGE("str is null\n"); - return; - } - - addr = strtoul(str, 0, 16); - DSP_LOGD("str:%s addr:0x%x\n", str, addr); - - val = *(unsigned int*)addr; - send_pcm_data_to_ap(); -//send_msg_data_to_ap(); - dsp_ipc_send_irq_to_ap(); - DSP_LOGI("read addr:0x%x value:0x%x\n", addr, val); - return; -} - -static void dsp_om_write_mem(char *str) -{ - char* str_addr = 0; - char* str_val = 0; - unsigned int addr = 0; - unsigned int val = 0; - if (!str) { - DSP_LOGE("str is null\n"); - return; - } - - str_addr = dsp_om_split_str(str, &str_val); - - if(!str_addr || !str_val) { - DSP_LOGE("str:%s str_addr:%s strValue:%s\n", str, str_addr ? str_addr : "null", str_val ? str_val : "null"); - return; - } - addr = strtoul(str_addr, 0, 16); - val= strtoul(str_val, 0, 16); - DSP_LOGI("str_addr:%s addr:%x str_val:%s val:%x\n", str_addr ? str_addr : "null", addr, str_val ? str_val : "null", val); - - *(unsigned int *)addr = val; - - return; - -} - -static void dsp_om_pcm_gain(char *str) -{ - char* str_addr = 0; - char* str_val = 0; - unsigned int addr = 0; - unsigned int val = 0; - if (!str) { - DSP_LOGE("str is null\n"); - return; - } - str_addr = dsp_om_split_str(str, &str_val); - if(!str_addr || !str_val) { - DSP_LOGE("str:%s str_addr:%s strValue:%s\n", str, str_addr ? str_addr : "null", str_val ? str_val : "null"); - return; - } - addr = strtoul(str_addr, 0, 16); - val= strtoul(str_val, 0, 16); - DSP_LOGI("str_addr:%s addr:%x str_val:%s val:%x\n", str_addr ? str_addr : "null", addr, str_val ? str_val : "null", val); - if(ReadData((char*)InpBuf, val) ){ - processAudio(OutBuf, InpBuf, (val/4)); - if(WriteData((char*)OutBuf, val)) { - MsgFlag = MSG_PROC; // indicate that the msg is processed. - DSP_LOGI("PCM gain processed\n"); - send_msg_data_to_ap(); - dsp_ipc_send_irq_to_ap(); // Indicate data is ready to pickup... Maybe you need to send a msg to AP. - } - else { - DSP_LOGI("PCM gain Write error\n"); - MsgFlag = MSG_INCOMP; - dsp_ipc_send_irq_to_ap();// Report error.. - } - } - else { - DSP_LOGI("PCM gain Read error\n"); - MsgFlag = MSG_INCOMP; - dsp_ipc_send_irq_to_ap(); - } - return; -} -typedef void (*om_proc_func)(char *str); - -struct om_proc_info { - char *om_proc_name; - om_proc_func func; -}; - -struct om_proc_info om_proc_table[] = { - {"read_mem", dsp_om_read_mem}, - {"write_mem", dsp_om_write_mem}, - {"pcm_gain", dsp_om_pcm_gain}, -}; - -om_proc_func dsp_om_get_func_by_name(char *name) -{ - unsigned int i = 0; - unsigned int func_num = sizeof(om_proc_table) / sizeof(om_proc_table[0]); - - if (!name) { - DSP_LOGE("name is null\n"); - return 0; - } - - for (i = 0; i < func_num; i++) - if (!strncmp((char *)om_proc_table[i].om_proc_name, name, strlen((char *)om_proc_table[i].om_proc_name))) - return om_proc_table[i].func; - - return 0; -} - -void dsp_om_func_proc(char *om_str, unsigned int str_len) -{ - char * cmd_name = 0; - char * str_param = 0; - om_proc_func proc_func = 0; - - cmd_name = dsp_om_split_str((char *)om_str, &str_param); - - DSP_LOGI("cmd_name:%s\n", cmd_name); - proc_func = dsp_om_get_func_by_name(cmd_name); - if (proc_func) - proc_func(str_param); - else - DSP_LOGE("do not find func\n"); -} -#endif - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/int_vector.S b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/int_vector.S deleted file mode 100644 index d579a55e..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/int_vector.S +++ /dev/null @@ -1,830 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/****************************************************************************** - int_vector.S -******************************************************************************/ -#include <xtensa/coreasm.h> -#include <xtensa/corebits.h> -#include <xtensa/config/system.h> -#include <xtensa/simcall.h> -#include "arch_hifi330.h" - -// .data - .section .dram0.data, "aw" -/* CP */ - .type g_awVosCoprocSaOffset,@object - .align 16 /* minimize crossing cache boundaries */ -g_awVosCoprocSaOffset: - .word XT_CP0_SA, XT_CP1_SA, XT_CP2_SA, XT_CP3_SA - .word XT_CP4_SA, XT_CP5_SA, XT_CP6_SA, XT_CP7_SA - -/* CP n's CPENABLE bit. */ - .type g_bVosCoprocMask,@object - .align 16,,8 /* try to keep it all in one cache line */ -g_bVosCoprocMask: - .byte 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 - -/* Owner of CP (0 = unowned). */ - .global g_awVosCoprocOwnerSa - .type g_awVosCoprocOwnerSa,@object - .align 16,,XCHAL_CP_MAX<<2 /* minimize crossing cache boundaries */ -g_awVosCoprocOwnerSa: - .space XCHAL_CP_MAX << 2,0 - - .global g_strVosPanicMessage - .align 4 -g_strVosPanicMessage: - .string "\npanic at addr 0x%08x.\n" - - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_Panic - .type OS_Panic,@function - .align 4 -/***************************************************************************** - OS_Panic -*****************************************************************************/ -OS_Panic: - -#ifdef ZOS_SIM - /*panic at addr*/ - addi a4, a0, -3 /* point to call0 */ - movi a3, g_strVosPanicMessage - movi a2, SYS_log_msg - simcall - movi a2, SYS_gdb_abort - simcall -#else - /*low & med*/ - rsil a2, XCHAL_EXCM_LEVEL /* disable all low & med ints */ -1: j 1b /* loop infinitely */ -#endif - - .end literal_prefix - - .begin literal_prefix .DebugExceptionVector - .section .DebugExceptionVector.text, "ax" - .global OS_DebugExceptionVector - .align 4 -/***************************************************************************** -_DebugExceptionVector -*****************************************************************************/ -OS_DebugExceptionVector: -#ifdef ZOS_SIM - wsr a2, EXCSAVE+XCHAL_DEBUGLEVEL - movi a2, SYS_gdb_enter_sktloop - simcall -#else - wsr a0, EXCSAVE+XCHAL_DEBUGLEVEL - call0 OS_Panic - rfi XCHAL_DEBUGLEVEL -#endif - - .end literal_prefix - - - .begin literal_prefix .DoubleExceptionVector - .section .DoubleExceptionVector.text, "ax" - .global OS_DoubleExceptionVector - .align 4 -/***************************************************************************** - OS_DoubleExceptionVector -*****************************************************************************/ -OS_DoubleExceptionVector: - call0 OS_Panic /* does not return */ - rfde /* make a0 point here not later */ - - .end literal_prefix - - - .begin literal_prefix .KernelExceptionVector - .section .KernelExceptionVector.text, "ax" - .global OS_KernelExceptionVector - .align 4 -/***************************************************************************** - _KernelExceptionVector -*****************************************************************************/ -OS_KernelExceptionVector: - call0 OS_Panic /* does not return */ - rfe /* make a0 point here not later */ - - .end literal_prefix - - - .begin literal_prefix .UserExceptionVector - .section .UserExceptionVector.text, "ax" - .global OS_UserExceptionVector - .type OS_UserExceptionVector,@function - .align 4 -/***************************************************************************** - _UserExceptionVector -*****************************************************************************/ -OS_UserExceptionVector: - wsr a0, EXCSAVE_1 /* preserve a0 */ - call0 OS_UserExc /* user exception handler */ - /* never returns here - call0 is used as a jump (see note at top) */ - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - - .align 4 -OS_CoProcessorExc: - s32i a5, sp, XT_STK_A5 /* save a5 */ - addi a5, a0, -EXCCAUSE_CP0_DISABLED /* a0 = CP index */ - bgei a5, XCHAL_CP_MAX, .L_xt_user_exc_not_coproc - call0 OS_CoProcessorException /* in window vectors section */ - /* never returns here - call0 is used as a jump (see note at top) */ - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .align 4 -OS_AllocExc: - call0 OS_AllocaException /* in window vectors section */ - /* never returns here - call0 is used as a jump (see note at top) */ - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .align 4 -OS_SyscallExc: - call0 OS_SyscallException - /* never returns here - call0 is used as a jump (see note at top) */ - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_UserExc - .type OS_UserExc,@function - .align 4 -OS_UserExc: - rsr a0, EXCCAUSE - beqi a0, EXCCAUSE_ALLOCA, OS_AllocExc - beqi a0, EXCCAUSE_SYSCALL, OS_SyscallExc - - mov a0, sp /* sp == a1 */ - addi sp, sp, -XT_STK_FRMSZ /* allocate interrupt stack frame */ - s32i a0, sp, XT_STK_A1 /* save pre-interrupt SP */ - rsr a0, PS /* save interruptee's PS */ - s32i a0, sp, XT_STK_PS - rsr a0, EPC_1 /* save interruptee's PC */ - s32i a0, sp, XT_STK_PC - rsr a0, EXCSAVE_1 /* save interruptee's a0 */ - s32i a0, sp, XT_STK_A0 - movi a0, OS_UserExit /* save exit point for dispatch */ - s32i a0, sp, XT_STK_EXIT - - rsr a0, EXCCAUSE - bgeui a0, EXCCAUSE_CP0_DISABLED, OS_CoProcessorExc - -.L_xt_user_exc_not_coproc: - - - call0 XT_RTOS_INT_ENTER - - - movi a0, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE - wsr a0, PS - rsync - - rsr a2, EXCCAUSE - beqi a2, EXCCAUSE_LEVEL1INTERRUPT, .L_xt_user_int - mov a6,a2 - mov a7,a1 - /*User exception*/ - call4 OS_UserexecHandler - j .L_xt_user_done - -.L_xt_user_int: - /* level 1 int */ - rsr a2, INTENABLE - rsr a3, INTERRUPT - movi a4, XCHAL_INTLEVEL1_MASK - and a2, a2, a3 - and a2, a2, a4 - beqz a2, .L_int_done1 - - neg a3,a2 - and a3,a3,a2 - wsr a3,INTCLEAR - - find_ls_one a2, a3 - mov a6,a2 - call4 OS_EnterIntHook - - mov a6,a2 - call4 OS_InterruptHandler - - mov a6,a2 - call4 OS_ExitIntHook - j .L_xt_user_int - -.L_int_done1: - - -.L_xt_user_done: - call0 XT_RTOS_INT_EXIT - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_UserExit - .type OS_UserExit,@function - .align 4 -OS_UserExit: - l32i a0, sp, XT_STK_PS /* retrieve interruptee's PS */ - wsr a0, PS - l32i a0, sp, XT_STK_PC /* retrieve interruptee's PC */ - wsr a0, EPC_1 - l32i a0, sp, XT_STK_A0 /* retrieve interruptee's A0 */ - l32i sp, sp, XT_STK_A1 /* remove interrupt stack frame */ - rsync /* ensure PS and EPC written */ - rfe /* PS.EXCM is cleared */ - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .type OS_SyscallException,@function - .align 4 -/***************************************************************************** - OS_SyscallException -*****************************************************************************/ -OS_SyscallException: - addi sp, sp, -XT_STK_FRMSZ /* allocate interrupt stack frame */ - s32i a12, sp, XT_STK_A12 /* _xt_context_save requires A12- */ - s32i a13, sp, XT_STK_A13 /* A13 to have already been saved */ - call0 OS_ContextSave - - - /* - 2)update PC*/ - rsr a2, EPC_1 - addi a3, a2, 3 - - rsr a0, LEND - bne a3, a0, 1f - rsr a0, LCOUNT - beqz a0, 1f - addi a0, a0, -1 - rsr a3, LBEG - wsr a0, LCOUNT - -1: wsr a3, EPC_1 - - /* Restore context,exception */ - call0 OS_ContextRestore - addi sp, sp, XT_STK_FRMSZ - - movi a0, -1 - movnez a2, a0, a2 /* return -1 if not syscall 0 */ - rsr a0, EXCSAVE_1 - rfe - - - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .type OS_CoProcessorException,@function - .align 4 -/***************************************************************************** - OS_CoProcessorException -*****************************************************************************/ -OS_CoProcessorException: /* a5 = CP index */ - - s32i a2, sp, XT_STK_A2 - s32i a3, sp, XT_STK_A3 - s32i a4, sp, XT_STK_A4 - s32i a15, sp, XT_STK_A15 - - - /* co-processor old owner new owner. */ - call0 XT_RTOS_CP_STATE /* a15 = new owner's save area */ - beqz a15, .L_xt_coproc_invalid /* not in a thread (invalid) */ - - mov a0, a5 /* a0 = CP index */ - movi a3, g_awVosCoprocOwnerSa - addx4 a3, a0, a3 /* a3 = &g_awVosCoprocOwnerSa[CP] */ - l32i a2, a3, 0 /* a2 = old owner's save area */ - - /* Enable the co-processor's bit in CPENABLE. */ - movi a4, g_bVosCoprocMask - rsr a5, CPENABLE /* a5 = CPENABLE */ - add a4, a4, a0 - l8ui a4, a4, 0 /* a4 = bitmask from CP index */ - or a5, a5, a4 /* a5 = CPENABLE + CP */ - wsr a5, CPENABLE - - - beq a15, a2, .L_xt_coproc_done /* new owner == old, we're done */ - - s32i a15, a3, 0 /* g_awVosCoprocOwnerSa[CP] = new */ - - l8ui a5, a15, XT_CPSTORED /* a5 = new owner's old CPSTORED */ - neg a3, a4 - addi a3, a3, -1 /* a3 = ~a4 (bitmask for CP) */ - and a3, a5, a3 /* clr CP in new owner's CPSTORED */ - s8i a3, a15, XT_CPSTORED /* update new owner's CPSTORED */ - - /* Adjust new owner's save area pointers to area for CP n. */ - movi a3, g_awVosCoprocSaOffset - and a5, a5, a4 /* a5 = new owner's CP is stored */ - addx4 a3, a0, a3 /* a3 = &OS_CoprocSaOffset[CP] */ - l32i a3, a3, 0 /* a3 = XT_CP[CP]_SA */ - add a15, a15, a3 /* a15 = new owner's area for CP */ - moveqz a15, a5, a5 /* a15 = 0 if state not stored */ - - rsync /* ensure wsr.CPENABLE is complete */ - beqz a2, .L_xt_coproc_new /* no old owner to save */ - - /* If old owner still needs CP, clear CP in CPENABLE and set in CPSTORED. */ - l8ui a5, a2, XT_CPENABLE /* a5 = old owner's CPENABLE */ - and a4, a5, a4 /* a4 = CP in old owner CPENABLE */ - beqz a4, .L_xt_coproc_new /* discard old owner's CP state */ - - sub a5, a5, a4 /* clr CP in old owner's CPENABLE */ - s8i a5, a2, XT_CPENABLE /* update old owner's CPENABLE */ - l8ui a5, a2, XT_CPSTORED /* a5 = old owner's CPSTORED */ - or a5, a5, a4 /* set CP in old owner's CPSTORED */ - s8i a5, a2, XT_CPSTORED /* update old owner's CPSTORED */ - - /* Save co-processor state of old owner. */ -.Ln_xt_coproc_old: - add a2, a2, a3 /* a2 = old owner's area for CP */ - mov a3, a0 /* a3 = CP index */ - /* - The config-specific HAL macro invoked below destroys a2-5, preserves a0-1. - It is theoretically possible for Xtensa processor designers to write TIE - that causes more address registers to be affected, but it is generally - unlikely. If that ever happens, more registers needs to be saved/restored - around this macro invocation, and the value in a15 needs to be recomputed. - */ - xchal_cpi_store_funcbody - - /* Restore co-processor state of new owner. */ -.L_xt_coproc_new: - beqz a15, .L_xt_coproc_done /* no valid state to restore */ - mov a2, a15 /* a2 = new owner's area for CP */ - mov a3, a0 /* a3 = CP index */ - - xchal_cpi_load_funcbody - - -.L_xt_coproc_done: - l32i a15, sp, XT_STK_A15 - l32i a5, sp, XT_STK_A5 - l32i a4, sp, XT_STK_A4 - l32i a3, sp, XT_STK_A3 - l32i a2, sp, XT_STK_A2 - call0 OS_UserExit - -.L_xt_coproc_invalid: - call0 OS_Panic /* not in a thread (invalid) */ - .end literal_prefix - - .begin literal_prefix .Level2InterruptVector - .section .Level2InterruptVector.text, "ax" - .global OS_Level2Vector - .type OS_Level2Vector,@function - .align 4 -/***************************************************************************** - _Level2Vector -*****************************************************************************/ -OS_Level2Vector: - wsr a0, EXCSAVE_2 /* preserve a0 */ - call0 OS_Medint2 /* load interrupt handler */ - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .extern OS_InterruptHandler - .type OS_Medint2,@function - .align 4 -OS_Medint2: - -#movi a1, 0xdeadbeef - movi a1, 0xe8075000 - movi a2, 0xe8075e30 /*HIFI_RESERVE1_LOCATION*/ - s32i a1, a2, 0 - - mov a0, sp /* sp == a1 */ - addi sp, sp, -XT_STK_FRMSZ /* allocate interrupt stack frame */ - s32i a0, sp, XT_STK_A1 /* save pre-interrupt SP */ - rsr a0, EPS_2 /* save interruptee's PS */ - s32i a0, sp, XT_STK_PS - rsr a0, EPC_2 /* save interruptee's PC */ - s32i a0, sp, XT_STK_PC - rsr a0, EXCSAVE_2 /* save interruptee's a0 */ - s32i a0, sp, XT_STK_A0 - movi a0, OS_Medint2Exit /* save exit point for dispatch */ - s32i a0, sp, XT_STK_EXIT - - call0 XT_RTOS_INT_ENTER - - movi a0, PS_INTLEVEL(2) | PS_UM | PS_WOE - wsr a0, PS - rsync - - -.L_ProcAllInt2: - rsr a2, INTENABLE - rsr a3, INTERRUPT - movi a4, XCHAL_INTLEVEL2_MASK - and a2, a2, a3 - and a2, a2, a4 - beqz a2, .L_int_done2 - - neg a3,a2 - and a3,a3,a2 - wsr a3,INTCLEAR - - find_ls_one a2, a3 - mov a6,a2 - call4 OS_EnterIntHook - - mov a6,a2 - call4 OS_InterruptHandler - - mov a6,a2 - call4 OS_ExitIntHook - j .L_ProcAllInt2 - -.L_int_done2: - call0 XT_RTOS_INT_EXIT - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_Medint2Exit - .type OS_Medint2Exit,@function - .align 4 -OS_Medint2Exit: - /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, XT_STK_PS /* retrieve interruptee's PS */ - wsr a0, EPS_2 - l32i a0, sp, XT_STK_PC /* retrieve interruptee's PC */ - wsr a0, EPC_2 - l32i a0, sp, XT_STK_A0 /* retrieve interruptee's A0 */ - l32i sp, sp, XT_STK_A1 /* remove interrupt stack frame */ - rsync /* ensure EPS and EPC written */ - rfi 2 - .end literal_prefix - - - .begin literal_prefix .Level3InterruptVector - .section .Level3InterruptVector.text, "ax" - .global OS_Level3Vector - .type OS_Level3Vector,@function - .align 4 -/***************************************************************************** - _Level3Vector -*****************************************************************************/ -OS_Level3Vector: - wsr a0, EXCSAVE_3 /* preserve a0 */ - call0 OS_MedInt3 /* load interrupt handler */ - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .extern OS_InterruptHandler - .type OS_MedInt3,@function - .align 4 -OS_MedInt3: - - mov a0, sp /* sp == a1 */ - addi sp, sp, -XT_STK_FRMSZ /* allocate interrupt stack frame */ - s32i a0, sp, XT_STK_A1 /* save pre-interrupt SP */ - rsr a0, EPS_3 /* save interruptee's PS */ - s32i a0, sp, XT_STK_PS - rsr a0, EPC_3 /* save interruptee's PC */ - s32i a0, sp, XT_STK_PC - rsr a0, EXCSAVE_3 /* save interruptee's a0 */ - s32i a0, sp, XT_STK_A0 - movi a0, OS_Medint3Exit /* save exit point for dispatch */ - s32i a0, sp, XT_STK_EXIT - - call0 XT_RTOS_INT_ENTER - - movi a0, PS_INTLEVEL(3) | PS_UM | PS_WOE - wsr a0, PS - rsync - - -.L_ProcAllInt3: - rsr a2, INTENABLE - rsr a3, INTERRUPT - movi a4, XCHAL_INTLEVEL3_MASK - and a2, a2, a3 - and a2, a2, a4 - beqz a2, .L_int_done3 - - neg a3,a2 - and a3,a3,a2 - wsr a3,INTCLEAR - - find_ls_one a2, a3 - mov a6,a2 - call4 OS_EnterIntHook - - mov a6,a2 - call4 OS_InterruptHandler - - mov a6,a2 - call4 OS_ExitIntHook - j .L_ProcAllInt3 - -.L_int_done3: - - call0 XT_RTOS_INT_EXIT - - .end literal_prefix - - .begin literal_prefix .iram0 - .section .iram0.text, "ax" - .global OS_Medint3Exit - .type OS_Medint3Exit,@function - .align 4 -OS_Medint3Exit: - /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, XT_STK_PS /* retrieve interruptee's PS */ - wsr a0, EPS_3 - l32i a0, sp, XT_STK_PC /* retrieve interruptee's PC */ - wsr a0, EPC_3 - l32i a0, sp, XT_STK_A0 /* retrieve interruptee's A0 */ - l32i sp, sp, XT_STK_A1 /* remove interrupt stack frame */ - rsync /* ensure EPS and EPC written */ - rfi 3 - .end literal_prefix - - - .begin literal_prefix .NMIExceptionVector - .section .NMIExceptionVector.text, "ax" - .global OS_NMIExceptionVector - .align 8 -/***************************************************************************** - OS_NMIExceptionVector -*****************************************************************************/ -OS_NMIExceptionVector: - /*wsr a3, 213 - wsr a4, 214*/ - - /*movi a3, 0x0 - movi a4, 0xf711a510 - s32i a3, a4, 0*/ - - /*rsr a3, 213 - rsr a4, 214*/ - - movi a0, PS_INTLEVEL(3) | PS_UM | PS_WOE - wsr a0, PS - rsync - rsr a2, EXCCAUSE - mov a6,a2 - mov a7,a1 - call4 OS_NmiHook - - rfi XCHAL_NMILEVEL - - .end literal_prefix - - .section .WindowVectors.text, "ax" - -/* --------------------------------------------------------------------------------- -Window Overflow Exception for Call4. - -Invoked if a call[i] referenced a register (a4-a15) -that contains data from ancestor call[j]; -call[j] had done a call4 to call[j+1]. -On entry here: - window rotated to call[j] start point; - a0-a3 are registers to be saved; - a4-a15 must be preserved; - a5 is call[j+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0x0 - .global _WindowOverflow4 -_WindowOverflow4: - - s32e a0, a5, -16 /* save a0 to call[j+1]'s stack frame */ - s32e a1, a5, -12 /* save a1 to call[j+1]'s stack frame */ - s32e a2, a5, -8 /* save a2 to call[j+1]'s stack frame */ - s32e a3, a5, -4 /* save a3 to call[j+1]'s stack frame */ - rfwo /* rotates back to call[i] position */ - -/* --------------------------------------------------------------------------------- -Window Underflow Exception for Call4 - -Invoked by RETW returning from call[i+1] to call[i] -where call[i]'s registers must be reloaded (not live in ARs); -where call[i] had done a call4 to call[i+1]. -On entry here: - window rotated to call[i] start point; - a0-a3 are undefined, must be reloaded with call[i].reg[0..3]; - a4-a15 must be preserved (they are call[i+1].reg[0..11]); - a5 is call[i+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0x40 - .global _WindowUnderflow4 -_WindowUnderflow4: - - l32e a0, a5, -16 /* restore a0 from call[i+1]'s stack frame */ - l32e a1, a5, -12 /* restore a1 from call[i+1]'s stack frame */ - l32e a2, a5, -8 /* restore a2 from call[i+1]'s stack frame */ - l32e a3, a5, -4 /* restore a3 from call[i+1]'s stack frame */ - rfwu - - .global OS_AllocaException - .align 4 -/***************************************************************************** - OS_AllocaException -*****************************************************************************/ -OS_AllocaException: - - rsr a0, WINDOWBASE /* grab WINDOWBASE before rotw changes it */ - rotw -1 /* WINDOWBASE goes to a4, new a0-a3 are scratch */ - rsr a2, PS - extui a3, a2, XCHAL_PS_OWB_SHIFT, XCHAL_PS_OWB_BITS - xor a3, a3, a4 /* bits changed from old to current windowbase */ - rsr a4, EXCSAVE_1 /* restore original a0 (now in a4) */ - slli a3, a3, XCHAL_PS_OWB_SHIFT - xor a2, a2, a3 /* flip changed bits in old window base */ - wsr a2, PS /* update PS.OWB to new window base */ - rsync - - _bbci.l a4, 31, _WindowUnderflow4 - rotw -1 /* original a0 goes to a8 */ - _bbci.l a8, 30, _WindowUnderflow8 - rotw -1 - j _WindowUnderflow12 - - - -/* --------------------------------------------------------------------------------- -Window Overflow Exception for Call8 - -Invoked if a call[i] referenced a register (a4-a15) -that contains data from ancestor call[j]; -call[j] had done a call8 to call[j+1]. -On entry here: - window rotated to call[j] start point; - a0-a7 are registers to be saved; - a8-a15 must be preserved; - a9 is call[j+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0x80 - .global _WindowOverflow8 -_WindowOverflow8: - - s32e a0, a9, -16 /* save a0 to call[j+1]'s stack frame */ - l32e a0, a1, -12 /* a0 <- call[j-1]'s sp - (used to find end of call[j]'s frame) */ - s32e a1, a9, -12 /* save a1 to call[j+1]'s stack frame */ - s32e a2, a9, -8 /* save a2 to call[j+1]'s stack frame */ - s32e a3, a9, -4 /* save a3 to call[j+1]'s stack frame */ - s32e a4, a0, -32 /* save a4 to call[j]'s stack frame */ - s32e a5, a0, -28 /* save a5 to call[j]'s stack frame */ - s32e a6, a0, -24 /* save a6 to call[j]'s stack frame */ - s32e a7, a0, -20 /* save a7 to call[j]'s stack frame */ - rfwo /* rotates back to call[i] position */ - -/* --------------------------------------------------------------------------------- -Window Underflow Exception for Call8 - -Invoked by RETW returning from call[i+1] to call[i] -where call[i]'s registers must be reloaded (not live in ARs); -where call[i] had done a call8 to call[i+1]. -On entry here: - window rotated to call[i] start point; - a0-a7 are undefined, must be reloaded with call[i].reg[0..7]; - a8-a15 must be preserved (they are call[i+1].reg[0..7]); - a9 is call[i+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0xC0 - .global _WindowUnderflow8 -_WindowUnderflow8: - - l32e a0, a9, -16 /* restore a0 from call[i+1]'s stack frame */ - l32e a1, a9, -12 /* restore a1 from call[i+1]'s stack frame */ - l32e a2, a9, -8 /* restore a2 from call[i+1]'s stack frame */ - l32e a7, a1, -12 /* a7 <- call[i-1]'s sp - (used to find end of call[i]'s frame) */ - l32e a3, a9, -4 /* restore a3 from call[i+1]'s stack frame */ - l32e a4, a7, -32 /* restore a4 from call[i]'s stack frame */ - l32e a5, a7, -28 /* restore a5 from call[i]'s stack frame */ - l32e a6, a7, -24 /* restore a6 from call[i]'s stack frame */ - l32e a7, a7, -20 /* restore a7 from call[i]'s stack frame */ - rfwu - -/* --------------------------------------------------------------------------------- -Window Overflow Exception for Call12 - -Invoked if a call[i] referenced a register (a4-a15) -that contains data from ancestor call[j]; -call[j] had done a call12 to call[j+1]. -On entry here: - window rotated to call[j] start point; - a0-a11 are registers to be saved; - a12-a15 must be preserved; - a13 is call[j+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0x100 - .global _WindowOverflow12 -_WindowOverflow12: - - s32e a0, a13, -16 /* save a0 to call[j+1]'s stack frame */ - l32e a0, a1, -12 /* a0 <- call[j-1]'s sp - (used to find end of call[j]'s frame) */ - s32e a1, a13, -12 /* save a1 to call[j+1]'s stack frame */ - s32e a2, a13, -8 /* save a2 to call[j+1]'s stack frame */ - s32e a3, a13, -4 /* save a3 to call[j+1]'s stack frame */ - s32e a4, a0, -48 /* save a4 to end of call[j]'s stack frame */ - s32e a5, a0, -44 /* save a5 to end of call[j]'s stack frame */ - s32e a6, a0, -40 /* save a6 to end of call[j]'s stack frame */ - s32e a7, a0, -36 /* save a7 to end of call[j]'s stack frame */ - s32e a8, a0, -32 /* save a8 to end of call[j]'s stack frame */ - s32e a9, a0, -28 /* save a9 to end of call[j]'s stack frame */ - s32e a10, a0, -24 /* save a10 to end of call[j]'s stack frame */ - s32e a11, a0, -20 /* save a11 to end of call[j]'s stack frame */ - rfwo /* rotates back to call[i] position */ - -/* --------------------------------------------------------------------------------- -Window Underflow Exception for Call12 - -Invoked by RETW returning from call[i+1] to call[i] -where call[i]'s registers must be reloaded (not live in ARs); -where call[i] had done a call12 to call[i+1]. -On entry here: - window rotated to call[i] start point; - a0-a11 are undefined, must be reloaded with call[i].reg[0..11]; - a12-a15 must be preserved (they are call[i+1].reg[0..3]); - a13 is call[i+1]'s stack pointer. --------------------------------------------------------------------------------- -*/ - - .org 0x140 - .global _WindowUnderflow12 -_WindowUnderflow12: - - l32e a0, a13, -16 /* restore a0 from call[i+1]'s stack frame */ - l32e a1, a13, -12 /* restore a1 from call[i+1]'s stack frame */ - l32e a2, a13, -8 /* restore a2 from call[i+1]'s stack frame */ - l32e a11, a1, -12 /* a11 <- call[i-1]'s sp - (used to find end of call[i]'s frame) */ - l32e a3, a13, -4 /* restore a3 from call[i+1]'s stack frame */ - l32e a4, a11, -48 /* restore a4 from end of call[i]'s stack frame */ - l32e a5, a11, -44 /* restore a5 from end of call[i]'s stack frame */ - l32e a6, a11, -40 /* restore a6 from end of call[i]'s stack frame */ - l32e a7, a11, -36 /* restore a7 from end of call[i]'s stack frame */ - l32e a8, a11, -32 /* restore a8 from end of call[i]'s stack frame */ - l32e a9, a11, -28 /* restore a9 from end of call[i]'s stack frame */ - l32e a10, a11, -24 /* restore a10 from end of call[i]'s stack frame */ - l32e a11, a11, -20 /* restore a11 from end of call[i]'s stack frame */ - rfwu - - - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/reset.S b/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/reset.S deleted file mode 100644 index b2cb2688..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/hikey/reset.S +++ /dev/null @@ -1,460 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/****************************************************************************** - reset.S - reset vector for BALONGV7R1 architechure,Any problem pls refer - to the Xtensa Microprocessor Programmer's Guide. -******************************************************************************/ - -#include <xtensa/coreasm.h> -#include <xtensa/simcall.h> -#include "reset.h" - - .begin literal_prefix .ResetVector - .section .ResetVector.text, "ax" - .global _ResetVector - .align 4 - -_ResetVector: - j _Reset - - .end literal_prefix - - /***************************************************************************** - Reset - *****************************************************************************/ - .begin literal_prefix .Reset - .section .Reset.text, "ax" - .global _Reset - .align 4 - -_Reset: - /* clear all of interrupts*/ - movi a0, 0 - wsr a0, INTENABLE - - wsr a0, IBREAKA_0 - wsr a0, IBREAKA_1 - wsr a0, DBREAKA_0 - wsr a0, DBREAKA_1 - wsr a0, DBREAKC_0 - wsr a0, DBREAKC_1 - wsr a0, IBREAKENABLE - - /* ICOUNT,ICOUNTLEVEL,ICOUNTexception clear ICOUNT and ICOUNTLEVEL*/ - wsr a0, ICOUNT - wsr a0, ICOUNTLEVEL - isync - - /*debug disable XCHAL_DEBUGLEVEL*/ - rsil a1, XCHAL_DEBUGLEVEL - 1 - -// write windowbase and windowstart, then do rsync. -// reload a0 with 0, because registers may have moved after -// writing windowbase/windowstart. - wsr a0, CCOUNT - /* init register windows*/ - wsr a0, WINDOWBASE - rsync - movi a1, 1 - wsr a1, WINDOWSTART - - ssai 0 - - /*Level-1 init EXCSAVE_1 level-1 interrupt*/ - wsr a0, EXCSAVE_1 - wsr a0, EPC_1 - wsr a0, EXCCAUSE - - /*Level-2 init EXCSAVE_1 level-2 interrupt*/ - wsr a0, EPC_2 - wsr a0, EPS_2 - wsr a0, EXCSAVE_2 - - /*Level-3 init EXCSAVE_1 level-3 interrupt*/ - wsr a0, EPC_3 - wsr a0, EPS_3 - wsr a0, EXCSAVE_3 - - /*Level-4 init EXCSAVE_1 level-4 interrupt*/ - wsr a0, EPC_4 - wsr a0, EPS_4 - wsr a0, EXCSAVE_4 - - /*Level-5(DEBUG) init EXCSAVE_1 level-5 interrupt*/ - wsr a0, EPC_5 - wsr a0, EPS_5 - wsr a0, EXCSAVE_5 - - /*NMI init EXCSAVE_1 level-6(NMI) interrupt */ - wsr a0, EPC_6 - wsr a0, EPS_6 - wsr a0, EXCSAVE_6 - - - /*0/1/2 init timer 0&1 */ - wsr a0, CCOMPARE_0 - wsr a0, CCOMPARE_1 - //wsr a0, CCOMPARE_2 //hifi3 CCOMPARE_0 CCOMPARE_1 - - /* clear all of */ - movi a2, XCHAL_INTTYPE_MASK_EXTERN_EDGE | XCHAL_INTTYPE_MASK_SOFTWARE - wsr a2, INTCLEAR - - wsr a0, BR - - /* disable coprocessor */ - /*wsr a0, CPENABLE*/ - - movi a2, XCHAL_DEBUGLEVEL - 1 - wsr a2, PS - rsync - - - /*icache init icache */ -#if (XCHAL_ICACHE_SIZE != 0) - #if (XCHAL_ICACHE_SIZE == 8192) //212GP and 330HiFi - movi a2, 64 - #elif (XCHAL_ICACHE_SIZE == 16384) //232L and 570T - movi a2, 128 - #elif (XCHAL_ICACHE_SIZE == 32768) //BALONGV7R1 - movi a2, 256 - #elif (XCHAL_ICACHE_SIZE == 65536) //CHICAGO HIFI - movi a2, 256 - #endif - - /*icache unlock icache */ - #if (XCHAL_ICACHE_LINESIZE == 128) - movi a3, 0 - loop a2, .L0 - iiu a3, 0 - iiu a3, XCHAL_ICACHE_LINESIZE - addi a3, a3, XCHAL_ICACHE_LINESIZE*2 - - iiu a3, 0 - iiu a3, XCHAL_ICACHE_LINESIZE - addi a3, a3, XCHAL_ICACHE_LINESIZE*2 -.L0: - - #else - movi a3, 0 - loop a2, .L0 - iiu a3, 0 - iiu a3, XCHAL_ICACHE_LINESIZE - iiu a3, XCHAL_ICACHE_LINESIZE*2 - iiu a3, XCHAL_ICACHE_LINESIZE*3 - addi a3, a3, XCHAL_ICACHE_LINESIZE*4 -.L0: - #endif - - - #if (XCHAL_ICACHE_SIZE == 8192) //212GP and 330HiFi - movi a2, 64 - #elif (XCHAL_ICACHE_SIZE == 16384) //232L and 570T - movi a2, 128 - #elif (XCHAL_ICACHE_SIZE == 32768) //BALONGV7R1 - movi a2, 256 - #elif (XCHAL_ICACHE_SIZE == 65536) //CHICAGO HIFI - movi a2, 256 - #endif - - /*icache disable icache */ - movi a3, 0 - loop a2, .L1 - iii a3, 0 - iii a3, XCHAL_ICACHE_LINESIZE - iii a3, XCHAL_ICACHE_LINESIZE*2 - iii a3, XCHAL_ICACHE_LINESIZE*3 - addi a3, a3, XCHAL_ICACHE_LINESIZE*4 -.L1: - isync -#endif - - - - - /*dcache init dcache */ -#if (XCHAL_DCACHE_SIZE != 0) - #if (XCHAL_DCACHE_SIZE == 8192) //212GP and 330HiFi - movi a2, 64 - #elif (XCHAL_DCACHE_SIZE == 16384) //232L and 570T - movi a2, 128 - #elif (XCHAL_DCACHE_SIZE == 32768) //BALONGV7R1 - movi a2, 256 - #elif (XCHAL_DCACHE_SIZE == 65536) //CHICAGO HIFI - movi a2, 256 - #endif - - /*dcache unlock dcache */ - #if (XCHAL_DCACHE_LINESIZE == 128) - movi a3, 0 - loop a2, .L2 - diu a3, 0 - diu a3, XCHAL_DCACHE_LINESIZE - addi a3, a3, XCHAL_DCACHE_LINESIZE*2 - - diu a3, 0 - diu a3, XCHAL_DCACHE_LINESIZE - addi a3, a3, XCHAL_DCACHE_LINESIZE*2 -.L2: - - #else - movi a3, 0 - loop a2, .L2 - diu a3, 0 - diu a3, XCHAL_DCACHE_LINESIZE - diu a3, XCHAL_DCACHE_LINESIZE*2 - diu a3, XCHAL_DCACHE_LINESIZE*3 - addi a3, a3, XCHAL_DCACHE_LINESIZE*4 -.L2: - #endif - #if (XCHAL_DCACHE_SIZE == 8192) //212GP and 330HiFi - movi a2, 64 - #elif (XCHAL_DCACHE_SIZE == 16384) //232L and 570T - movi a2, 128 - #elif (XCHAL_DCACHE_SIZE == 32768) //BALONGV7R1 - movi a2, 256 - #elif (XCHAL_DCACHE_SIZE == 65536) //CHICAGO HIFI - movi a2, 256 - #endif - - - /*dcache disable dcache */ - movi a3, 0 - loop a2, .L3 - dii a3, 0 - dii a3, XCHAL_DCACHE_LINESIZE - dii a3, XCHAL_DCACHE_LINESIZE*2 - dii a3, XCHAL_DCACHE_LINESIZE*3 - addi a3, a3, XCHAL_DCACHE_LINESIZE*4 -.L3: - dsync -#endif - - /* - 0x00000000-0x1fffffff : caches off(bypass) - 0x20000000-0x3fffffff : caches off(bypass) - 0x40000000-0x5fffffff : caches off(bypass) - 0x60000000-0x7fffffff : caches off(bypass) - 0x80000000-0x9fffffff : caches off(bypass) - 0xa0000000-0xbfffffff : caches off(bypass) - 0xc0000000-0xdfffffff : caches on,0x00000000-0x1fffffff - 0xe0000000-0xffffffff : caches off(bypass),:0xe0000000~0xefffffff 0x20000000~0x2fffffff - */ - /* config the memory access right */ - movi a3, 0x00000000 /*0x00000000-0x1fffffff*/ - set_access_mode PIF_BYPASS /*can not access*/ - - movi a3, 0x20000000 /*0x20000000-0x3fffffff*/ - set_access_mode PIF_BYPASS - - movi a3, 0x40000000 /*0x40000000-0x5fffffff*/ -#if (XCHAL_DCACHE_LINESIZE == 128) - set_access_mode PIF_BYPASS -#else - set_access_mode PIF_BYPASS -#endif - - movi a3, 0x60000000 /*0x60000000-0x7fffffff*/ - set_access_mode PIF_BYPASS - - movi a3, 0x80000000 /*0x80000000-0x9fffffff*/ - #if (XCHAL_DCACHE_LINESIZE == 128) - set_access_mode PIF_BYPASS - #else - set_access_mode PIF_BYPASS - #endif - - movi a3, 0xa0000000 /*0xa0000000-0xbfffffff*/ - set_access_mode PIF_BYPASS - - movi a3, 0xc0000000 /*0xc0000000-0xdfffffff*/ - set_access_mode PIF_CACHED_WBA /*PIF_CACHED*/ - - movi a3, 0xe0000000 /*0xe0000000-0xffffffff*/ - set_access_mode PIF_BYPASS - - /* 0x40000000 0xe0000000, 0x50000000 0xf0000000,*/ - /*movi a2, 0x40000000 //vpn - movi a3, 0xe0000000 //ppn - movi a5, 0xE0000000 // tlb mask, upper 3 bits - and a4, a3, a5 // upper 3 bits of PPN area - and a7, a2, a5 // upper 3 bits of VPN area - - ritlb1 a5, a7 // get current PPN+AM of segment for I - rdtlb1 a6, a7 // get current PPN+AM of segment for D - extui a5, a5, 0, 4 // keep only AM for I - extui a6, a6, 0, 4 // keep only AM for D - add a2, a4, a5 // combine new PPN with orig AM for I - add a3, a4, a6 // combine new PPN with orig AM for D - witlb a2, a7 // write new tlb mapping for I - wdtlb a3, a7 // write new tlb mapping for D - */ - isync - dsync - - /* - prepare the environment of run C code - */ - movi sp, __stack - - movi a2, PS_WOE_MASK | PS_PROGSTACK_MASK - wsr a2, PS - rsync - - movi a8, _bss_start - movi a10, _bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone: - - movi a8, _ulpp_bss_start - movi a10, _ulpp_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone1 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone1: - -#ifdef HIFI_DTS_V3 - movi a8, _dtsv3_bss_start - movi a10, _dtsv3_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone2 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone2: -#endif - -#ifdef HIFI_DTS_V4 - movi a8, _dtsv4_bss_start - movi a10, _dtsv4_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone3 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone3: -#endif - -#ifdef HIFI_VLP - movi a8, _efr_fr_hr_vlpd_bss_start - movi a10, _efr_fr_hr_vlpd_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone4 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone4: - - movi a8, _amr_vlpd_bss_start - movi a10, _amr_vlpd_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone5 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone5: - - movi a8, _vlpd_bss_start - movi a10, _vlpd_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone6 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone6: - - movi a8, _amrwb_vlpd_bss_start - movi a10, _amrwb_vlpd_bss_end - sub a11, a10, a8 - srli a11, a11, 2 - - movi a9, 0 - loopnez a11, zerodone7 - s32i a9, a8, 0 - addi a8, a8, 4 -zerodone7: -#endif - -callmain: - -// Do NOT modify a1 here, it is the stack pointer. -// Use another register instead (a3?) -// Not sure why the NOPs are present. -#movi a1, 0xdeadbeef - movi a1, 0xe8073000 - movi a2, 0xe8075e10 /*HIFI_RESERVE1_LOCATION*/ - s32i a1, a2, 0 - - movi a0, 0 - movi a6, 0 /* clear argc*/ - movi a7, 0 /* clear argv*/ - movi a8, 0 /* clear envp*/ - movi a4, main - nop - nop - callx4 a4 - -reset_exit: - movi a2, SYS_exit -// Where does it go from here ? execution will fall through into -// whatever happens to follow. Either halt here or jump to some -// specific code. - - .end literal_prefix - -#ifdef VOS_VENUS_TEST_STUB - .text - .global sim_call - .type sim_call,@function - .align 4 -sim_call: - entry sp, 64 - addi a4, a3,-3 - movi a3, g_auwVosTestMessageBuf - movi a2, SYS_log_msg - simcall - retw - -#endif - - diff --git a/hifi/xaf/hifi-dpf/ipc/xt-shmem/xf-main.c b/hifi/xaf/hifi-dpf/ipc/xt-shmem/xf-main.c deleted file mode 100644 index f9178004..00000000 --- a/hifi/xaf/hifi-dpf/ipc/xt-shmem/xf-main.c +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-main.c - * - * DSP processing framework main file - * - ******************************************************************************/ - -#define MODULE_TAG MAIN - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#ifndef XAF_ENABLE_NON_HIKEY -volatile int waitstate; -#endif - -#ifdef XAF_PROFILE_DSP -/* ... MCPS/profile info */ -#include "xa_profiler.h" -#endif - -/******************************************************************************* - * Global data definition - ******************************************************************************/ -/* ...per-core execution data */ -xf_core_data_t xf_core_data[XF_CFG_CORES_NUM]; - -/* ...AP-DSP shared memory pool */ -xf_mm_pool_t xf_ap_shmem_pool; - -/* ...per-core local memory pool */ -xf_mm_pool_t xf_dsp_local_pool[XF_CFG_CORES_NUM]; - -#if XF_CFG_CORES_NUM > 1 -/* ...DSP cluster shared memory pool */ -xf_mm_pool_t xf_dsp_shmem_pool; -#endif - -/* ...per-core shared memory with read-only access */ -__xf_core_ro_data_t xf_core_ro_data[XF_CFG_CORES_NUM]; - -/* ...per-core shared memory with read-write access */ -__xf_core_rw_data_t xf_core_rw_data[XF_CFG_CORES_NUM]; - -/******************************************************************************* - * Memory buffers - take them from linker file somehow - tbd - ******************************************************************************/ - -/* ...unallocated memory region - AP-DSP shared memory buffer - export from linker somehow */ -//u8 xf_ap_shmem_buffer[XF_CFG_REMOTE_IPC_POOL_SIZE] __xf_shmem__; - -#if XF_CFG_CORES_NUM > 1 -/* ...unallocated DSP shared memory buffer */ -u8 xf_dsp_shmem_buffer[XF_CFG_LOCAL_IPC_POOL_SIZE] __xf_shmem__; -#endif - -/* ...unallocated per-core local memory (in 32-byte chunks) */ -#ifdef XAF_ENABLE_NON_HIKEY -u8 xf_dsp_local_buffer[XF_CFG_CORES_NUM][XF_CFG_LOCAL_POOL_SIZE] __xf_mm__; -#else -u8 xf_dsp_local_buffer[XF_CFG_CORES_NUM][XF_CFG_LOCAL_POOL_SIZE]; -//u8 g_tmp[2]; -#endif - -#ifdef XAF_PROFILE_DSP -xa_profiler prof; -#endif - -/******************************************************************************* - * Timer interrupt - tbd - ******************************************************************************/ - -/******************************************************************************* - * IPC layer initialization - ******************************************************************************/ - -/* ...system-specific IPC layer initialization */ -int xf_ipc_init(u32 core) -{ - xf_core_data_t *cd = XF_CORE_DATA(core); - xf_shmem_data_t *shmem = (xf_shmem_data_t *)XF_CFG_SHMEM_ADDRESS(core); - - /* ...initialize pointer to shared memory */ - cd->shmem = (xf_shmem_handle_t *)shmem; - shmem->buffer = (uint8_t *) HIFI_MUSIC_DATA_LOCATION; - /* ...global memory pool initialization */ -#ifdef XAF_ENABLE_NON_HIKEY - XF_CHK_API(xf_mm_init(&cd->shared_pool, shmem->buffer, XF_CFG_REMOTE_IPC_POOL_SIZE)); -#else - XF_CHK_API(xf_mm_init(&cd->shared_pool, (void *) HIFI_MUSIC_DATA_LOCATION, XF_CFG_REMOTE_IPC_POOL_SIZE)); -#endif - return 0; -} - -/******************************************************************************* - * Core executive loop - ******************************************************************************/ - -static void xf_core_loop(u32 core) -{ - /* ...initialize internal core structures */ - xf_core_init(core); - -#ifdef XAF_PROFILE_DSP -/* Profiler initialization */ - INIT_XA_PROFILER(prof,"DSP core"); -#endif - - for(;;) - { - /* ...wait in a low-power mode until event is triggered */ - xf_ipi_wait(core); - - /* ...service core event */ - xf_core_service(core); - } -} - -/******************************************************************************* - * Global entry point - ******************************************************************************/ - -int main(void) -{ -#if XF_CFG_CORES_NUM > 1 - u32 i; -#endif - - /* ...reset ro/rw core data - tbd */ - memset(xf_core_rw_data, 0, sizeof(xf_core_rw_data)); - memset(xf_core_ro_data, 0, sizeof(xf_core_ro_data)); - - TRACE_INIT("Xtensa Audio DSP Codec Server"); -#ifdef XAF_ENABLE_NON_HIKEY - /* ...initialize board */ - xf_board_init(); - - /* ...global framework data initialization */ - xf_global_init(); -#endif - -#if XF_CFG_CORES_NUM > 1 - /* ...DSP shared memory pool initialization */ - XF_CHK_API(xf_mm_init(&xf_dsp_shmem_pool, xf_dsp_shmem_buffer, XF_CFG_LOCAL_IPC_POOL_SIZE)); -#endif - - /* ...initialize per-core memory loop */ - XF_CHK_API(xf_mm_init(&xf_core_data[0].local_pool, xf_dsp_local_buffer[0], XF_CFG_LOCAL_POOL_SIZE)); - -#if XF_CFG_CORES_NUM > 1 - /* ...bring up all cores */ - for (i = 1; i < XF_CFG_CORES_NUM; i++) - { - /* ...wake-up secondary core somehow and make it execute xf_core_loop */ - xf_core_secondary_startup(i, xf_core_loop, i); - - } -#endif - - /* ...enter execution loop on master core #0 */ - xf_core_loop(0); - - /* ...not reachable */ - return 0; -} diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/mixer/xa-mixer.c b/hifi/xaf/hifi-dpf/plugins/cadence/mixer/xa-mixer.c deleted file mode 100644 index 0909d446..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/mixer/xa-mixer.c +++ /dev/null @@ -1,669 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-mixer.c - * - * Sample mixer plugin - * - ******************************************************************************/ - -#define MODULE_TAG MIXER - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf-plugin.h" -#include "audio/xa-mixer-api.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(PROCESS, 1); - -/******************************************************************************* - * Internal functions definitions - ******************************************************************************/ - -/* ...API structure */ -typedef struct XAPcmMixer -{ - /* ...mixer state */ - u32 state; - - /* ...number of samples in a frame */ - u32 frame_size; - - /* ...number of channels (channel mask?) */ - u32 channels; - - /* ...PCM sample width */ - u32 pcm_width; - - /* ...sampling rate */ - u32 sample_rate; - - /* ...number of bytes in input/output buffer */ - u32 buffer_size; - - /* ...master volume and individual track volumes*/ - u32 volume[XA_MIXER_MAX_TRACK_NUMBER + 1]; - - /* ...input buffers */ - void *input[XA_MIXER_MAX_TRACK_NUMBER]; - - /* ...number of samples in individual buffers */ - u32 input_length[XA_MIXER_MAX_TRACK_NUMBER]; - - /* ...output buffer */ - void *output; - - /* ...number of produced bytes - do I need that? have buffer-size already - tbd */ - u32 produced; - - /* ...scratch buffer pointer */ - void *scratch; - -} XAPcmMixer; - -/******************************************************************************* - * Mixer state flags - ******************************************************************************/ - -#define XA_MIXER_FLAG_PREINIT_DONE (1 << 0) -#define XA_MIXER_FLAG_POSTINIT_DONE (1 << 1) -#define XA_MIXER_FLAG_RUNNING (1 << 2) -#define XA_MIXER_FLAG_OUTPUT (1 << 3) -#define XA_MIXER_FLAG_COMPLETE (1 << 4) - -/******************************************************************************* - * DSP functions - ******************************************************************************/ - -#define DSP_SATURATE_S16(s32) \ - (s16)((s32) > 0x7fff ? 0x7fff : ((s32) < -0x8000 ? -0x8000 : (s32))) - -/* ...mixer preinitialization (default parameters) */ -static inline void xa_mixer_preinit(XAPcmMixer *d) -{ - u32 i; - - /* ...pre-configuration initialization; reset internal data */ - memset(d, 0, sizeof(*d)); - - /* ...set default parameters */ - d->pcm_width = 16, d->channels = 2, d->frame_size = 512; - - /* ...set default volumes (last index is a master volume)*/ - for (i = 0; i <= XA_MIXER_MAX_TRACK_NUMBER; i++) - { - d->volume[i] = ((1 << 12) << 16) | (1 << 12); - } -} - -/* ...do mixing of stereo PCM-16 streams */ -static XA_ERRORCODE xa_mixer_do_execute_stereo_16bit(XAPcmMixer *d) -{ - s16 *output = d->output; - s16 *b[XA_MIXER_MAX_TRACK_NUMBER]; - u16 v_l[XA_MIXER_MAX_TRACK_NUMBER]; - u16 v_r[XA_MIXER_MAX_TRACK_NUMBER]; - u16 w_l, w_r; - u32 t32; - u32 i, j; - - /* ...retrieve master volume - assume up to 24dB amplifying (4 bits) */ - t32 = d->volume[XA_MIXER_MAX_TRACK_NUMBER]; - w_l = (u16)(t32 & 0xFFFF), w_r = (u16)(t32 >> 16); - - /* ...prepare individual tracks */ - for (j = 0; j < XA_MIXER_MAX_TRACK_NUMBER; j++) - { - u32 n = d->input_length[j]; - - /* ...check if we have input buffer available */ - if (n == 0) - { - /* ...output silence (multiply garbage in the scratch buffer by 0) */ - b[j] = d->scratch; - v_l[j] = v_r[j] = 0; - } - else - { - s32 k = (s32)(d->buffer_size - n); - - /* ...put input buffer */ - XF_CHK_ERR(b[j] = d->input[j], XA_MIXER_EXEC_FATAL_INPUT); - - /* ...if length is not sufficient, pad buffer remainder */ - (k > 0 ? memset((void *)b[j] + n, 0x00, k) : 0); - - /* ...set individual track volume/balance */ - t32 = d->volume[j]; - v_l[j] = (u16)(t32 & 0xFFFF), v_r[j] = (u16)(t32 >> 16); - } - - TRACE(PROCESS, _b("b[%u] = %p%s"), j, b[j], (n == 0 ? " - scratch" : "")); - } - - /* ...process all tracks */ - for (i = 0; i < d->frame_size; i++) - { - s32 l32 = 0, r32 = 0; - - /* ...fill-in every channel in our map (unrolls loop here) */ - for (j = 0; j < XA_MIXER_MAX_TRACK_NUMBER; j++) - { - /* ...left channel processing (no saturation here yet) */ - l32 += *b[j]++ * v_l[j]; - - /* ...right channel processing */ - r32 += *b[j]++ * v_r[j]; - } - - /* ...normalize (truncate towards -inf) and multiply by master volume */ - l32 = ((l32 >> 12) * w_l) >> 12; - r32 = ((r32 >> 12) * w_r) >> 12; - - /* ...saturate and store in buffer */ - *output++ = DSP_SATURATE_S16(l32); - *output++ = DSP_SATURATE_S16(r32); - } - - /* ...save total number of produced bytes */ - d->produced = (u32)((void *)output - d->output); - - /* ...put flag saying we have output buffer */ - d->state |= XA_MIXER_FLAG_OUTPUT; - - TRACE(PROCESS, _b("produced: %u bytes (%u samples)"), d->produced, d->frame_size); - - /* ...reset input buffer length? */ - //memset(d->input_length, 0, sizeof(d->input_length)); - - /* ...return success result code */ - return XA_NO_ERROR; -} - -/* ...runtime reset */ -static XA_ERRORCODE xa_mixer_do_runtime_init(XAPcmMixer *d) -{ - /* ...no special processing is needed here */ - return XA_NO_ERROR; -} - -/******************************************************************************* - * Commands processing - ******************************************************************************/ - -/* ...codec API size query */ -static XA_ERRORCODE xa_mixer_get_api_size(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...check parameters are sane */ - XF_CHK_ERR(pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...retrieve API structure size */ - *(WORD32 *)pv_value = sizeof(*d); - - return XA_NO_ERROR; -} - -/* ...standard codec initialization routine */ -static XA_ERRORCODE xa_mixer_init(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check - mixer must be valid */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...process particular initialization type */ - switch (i_idx) - { - case XA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS: - { - /* ...pre-configuration initialization; reset internal data */ - xa_mixer_preinit(d); - - /* ...and mark mixer has been created */ - d->state = XA_MIXER_FLAG_PREINIT_DONE; - - return XA_NO_ERROR; - } - - case XA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS: - { - /* ...post-configuration initialization (all parameters are set) */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...calculate input/output buffer size in bytes */ - d->buffer_size = d->channels * d->frame_size * (d->pcm_width == 16 ? sizeof(s16) : sizeof(s32)); - - /* ...mark post-initialization is complete */ - d->state |= XA_MIXER_FLAG_POSTINIT_DONE; - - return XA_NO_ERROR; - } - - case XA_CMD_TYPE_INIT_PROCESS: - { - /* ...kick run-time initialization process; make sure mixer is setup */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...enter into execution stage */ - d->state |= XA_MIXER_FLAG_RUNNING; - - return XA_NO_ERROR; - } - - case XA_CMD_TYPE_INIT_DONE_QUERY: - { - /* ...check if initialization is done; make sure pointer is sane */ - XF_CHK_ERR(pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...put current status */ - *(WORD32 *)pv_value = (d->state & XA_MIXER_FLAG_RUNNING ? 1 : 0); - - return XA_NO_ERROR; - } - - default: - /* ...unrecognized command type */ - TRACE(ERROR, _x("Unrecognized command type: %X"), i_idx); - return XA_API_FATAL_INVALID_CMD_TYPE; - } -} - -/* ...set mixer configuration parameter */ -static XA_ERRORCODE xa_mixer_set_config_param(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - u32 i_value; - - /* ...sanity check - mixer pointer must be sane */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...pre-initialization must be completed, mixer must be idle */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...get parameter value */ - i_value = (u32) *(WORD32 *)pv_value; - - /* ...process individual configuration parameter */ - switch (i_idx) - { - case XA_MIXER_CONFIG_PARAM_PCM_WIDTH: - /* ...check value is permitted (16 bits only) */ - XF_CHK_ERR(i_value == 16, XA_MIXER_CONFIG_NONFATAL_RANGE); - d->pcm_width = (u32)i_value; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_CHANNELS: - /* ...allow stereo only */ - XF_CHK_ERR(i_value == 2, XA_MIXER_CONFIG_NONFATAL_RANGE); - d->channels = (u32)i_value; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_SAMPLE_RATE: - /* ...set mixer sample rate */ - d->sample_rate = (u32)i_value; - return XA_NO_ERROR; - - default: - TRACE(ERROR, _x("Invalid parameter: %X"), i_idx); - return XA_API_FATAL_INVALID_CMD_TYPE; - } -} - -/* ...retrieve configuration parameter */ -static XA_ERRORCODE xa_mixer_get_config_param(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check - mixer must be initialized */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...make sure pre-initialization is completed */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...process individual configuration parameter */ - switch (i_idx) - { - case XA_MIXER_CONFIG_PARAM_INPUT_TRACKS: - /* ...return maximal number of input tracks supported */ - *(WORD32 *)pv_value = XA_MIXER_MAX_TRACK_NUMBER; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_SAMPLE_RATE: - /* ...return mixer sample rate */ - *(WORD32 *)pv_value = d->sample_rate; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_PCM_WIDTH: - /* ...return current PCM width */ - *(WORD32 *)pv_value = d->pcm_width; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_CHANNELS: - /* ...return current channel number */ - *(WORD32 *)pv_value = d->channels; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_FRAME_SIZE: - /* ...return current in/out frame length (in samples) */ - *(WORD32 *)pv_value = d->frame_size; - return XA_NO_ERROR; - - case XA_MIXER_CONFIG_PARAM_BUFFER_SIZE: - /* ...return current in/out frame length (in bytes) */ - *(WORD32 *)pv_value = d->buffer_size; - return XA_NO_ERROR; - - default: - TRACE(ERROR, _x("Invalid parameter: %X"), i_idx); - return XA_API_FATAL_INVALID_CMD_TYPE; - } -} - -/* ...execution command */ -static XA_ERRORCODE xa_mixer_execute(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check - mixer must be valid */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...mixer must be in running state */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_RUNNING, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...process individual command type */ - switch (i_idx) - { - case XA_CMD_TYPE_DO_EXECUTE: - /* ...perform mixing of the channels */ - return xa_mixer_do_execute_stereo_16bit(d); - - case XA_CMD_TYPE_DONE_QUERY: - /* ...check if processing is complete */ - XF_CHK_ERR(pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - *(WORD32 *)pv_value = (d->state & XA_MIXER_FLAG_COMPLETE ? 1 : 0); - return XA_NO_ERROR; - - case XA_CMD_TYPE_DO_RUNTIME_INIT: - /* ...reset mixer operation */ - return xa_mixer_do_runtime_init(d); - - default: - /* ...unrecognized command */ - TRACE(ERROR, _x("Invalid index: %X"), i_idx); - return XA_API_FATAL_INVALID_CMD_TYPE; - } -} - -/* ...set number of input bytes */ -static XA_ERRORCODE xa_mixer_set_input_bytes(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - u32 size; - - /* ...sanity check - check parameters */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...track index must be valid */ - XF_CHK_ERR(i_idx >= 0 && i_idx < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...mixer must be initialized */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...input buffer must exist */ - XF_CHK_ERR(d->input[i_idx], XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...input frame length should not be zero (in bytes) */ - XF_CHK_ERR((size = (u32)*(WORD32 *)pv_value) > 0, XA_MIXER_EXEC_NONFATAL_INPUT); - - /* ...all is correct; set input buffer length in bytes */ - d->input_length[i_idx] = size; - - return XA_NO_ERROR; -} - -/* ...get number of output bytes */ -static XA_ERRORCODE xa_mixer_get_output_bytes(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check - check parameters */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...track index must be zero */ - XF_CHK_ERR(i_idx == XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...mixer must be running */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_RUNNING, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...output buffer must exist */ - XF_CHK_ERR(d->output, XA_MIXER_EXEC_NONFATAL_OUTPUT); - - /* ...return number of produced bytes */ - *(WORD32 *)pv_value = (d->state & XA_MIXER_FLAG_OUTPUT ? d->buffer_size : 0); - - return XA_NO_ERROR; -} - -/* ...get number of consumed bytes */ -static XA_ERRORCODE xa_mixer_get_curidx_input_buf(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check - check parameters */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...track index must be valid */ - XF_CHK_ERR(i_idx >= 0 && i_idx < XA_MIXER_MAX_TRACK_NUMBER, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...mixer must be running */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_RUNNING, XA_MIXER_EXEC_FATAL_STATE); - - /* ...input buffer must exist */ - XF_CHK_ERR(d->input[i_idx], XA_MIXER_EXEC_FATAL_INPUT); - - /* ...return number of bytes consumed (always consume fixed-length chunk) */ - *(WORD32 *)pv_value = d->input_length[i_idx], d->input_length[i_idx] = 0; - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Memory information API - ******************************************************************************/ - -/* ..get total amount of data for memory tables */ -static XA_ERRORCODE xa_mixer_get_memtabs_size(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity checks */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check mixer is pre-initialized */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...we have all our tables inside API structure - good? tbd */ - *(WORD32 *)pv_value = 0; - - return XA_NO_ERROR; -} - -/* ..set memory tables pointer */ -static XA_ERRORCODE xa_mixer_set_memtabs_ptr(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity checks */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check mixer is pre-initialized */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...do not do anything; just return success - tbd */ - return XA_NO_ERROR; -} - -/* ...return total amount of memory buffers */ -static XA_ERRORCODE xa_mixer_get_n_memtabs(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity checks */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...we have N input buffers, 1 output buffer and 1 scratch buffer */ - *(WORD32 *)pv_value = XA_MIXER_MAX_TRACK_NUMBER + 1 + 1; - - return XA_NO_ERROR; -} - -/* ...return memory buffer data */ -static XA_ERRORCODE xa_mixer_get_mem_info_size(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...return frame buffer minimal size only after post-initialization is done */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...all buffers are of the same length */ - *(WORD32 *)pv_value = (WORD32) d->buffer_size; - - return XA_NO_ERROR; -} - -/* ...return memory alignment data */ -static XA_ERRORCODE xa_mixer_get_mem_info_alignment(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...return frame buffer minimal size only after post-initialization is done */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...all buffers are 4-bytes aligned */ - *(WORD32 *)pv_value = 4; - - return XA_NO_ERROR; -} - -/* ...return memory type data */ -static XA_ERRORCODE xa_mixer_get_mem_info_type(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...return frame buffer minimal size only after post-initialization is done */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - switch (i_idx) - { - case 0 ... XA_MIXER_MAX_TRACK_NUMBER - 1: - /* ...input buffers */ - *(WORD32 *)pv_value = XA_MEMTYPE_INPUT; - return XA_NO_ERROR; - - case XA_MIXER_MAX_TRACK_NUMBER: - /* ...output buffer */ - *(WORD32 *)pv_value = XA_MEMTYPE_OUTPUT; - return XA_NO_ERROR; - - case XA_MIXER_MAX_TRACK_NUMBER + 1: - /* ...scratch buffer */ - *(WORD32 *)pv_value = XA_MEMTYPE_SCRATCH; - return XA_NO_ERROR; - - default: - /* ...invalid index */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...set memory pointer */ -static XA_ERRORCODE xa_mixer_set_mem_ptr(XAPcmMixer *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be initialized */ - XF_CHK_ERR(d->state & XA_MIXER_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...select memory buffer */ - switch (i_idx) - { - case 0 ... XA_MIXER_MAX_TRACK_NUMBER - 1: - /* ...input buffers */ - d->input[i_idx] = pv_value; - return XA_NO_ERROR; - - case XA_MIXER_MAX_TRACK_NUMBER: - /* ...output buffer */ - d->output = pv_value; - return XA_NO_ERROR; - - case XA_MIXER_MAX_TRACK_NUMBER + 1: - /* ...scratch buffer */ - d->scratch = pv_value; - return XA_NO_ERROR; - - default: - /* ...invalid index */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/******************************************************************************* - * API command hooks - ******************************************************************************/ - -static XA_ERRORCODE (* const xa_mixer_api[])(XAPcmMixer *, WORD32, pVOID) = -{ - [XA_API_CMD_GET_API_SIZE] = xa_mixer_get_api_size, - - [XA_API_CMD_INIT] = xa_mixer_init, - [XA_API_CMD_SET_CONFIG_PARAM] = xa_mixer_set_config_param, - [XA_API_CMD_GET_CONFIG_PARAM] = xa_mixer_get_config_param, - - [XA_API_CMD_EXECUTE] = xa_mixer_execute, - [XA_API_CMD_SET_INPUT_BYTES] = xa_mixer_set_input_bytes, - [XA_API_CMD_GET_OUTPUT_BYTES] = xa_mixer_get_output_bytes, - [XA_API_CMD_GET_CURIDX_INPUT_BUF] = xa_mixer_get_curidx_input_buf, - - [XA_API_CMD_GET_MEMTABS_SIZE] = xa_mixer_get_memtabs_size, - [XA_API_CMD_SET_MEMTABS_PTR] = xa_mixer_set_memtabs_ptr, - [XA_API_CMD_GET_N_MEMTABS] = xa_mixer_get_n_memtabs, - [XA_API_CMD_GET_MEM_INFO_SIZE] = xa_mixer_get_mem_info_size, - [XA_API_CMD_GET_MEM_INFO_ALIGNMENT] = xa_mixer_get_mem_info_alignment, - [XA_API_CMD_GET_MEM_INFO_TYPE] = xa_mixer_get_mem_info_type, - [XA_API_CMD_SET_MEM_PTR] = xa_mixer_set_mem_ptr, -}; - -/* ...total numer of commands supported */ -#define XA_MIXER_API_COMMANDS_NUM (sizeof(xa_mixer_api) / sizeof(xa_mixer_api[0])) - -/******************************************************************************* - * API entry point - ******************************************************************************/ - -XA_ERRORCODE xa_mixer(xa_codec_handle_t p_xa_module_obj, WORD32 i_cmd, WORD32 i_idx, pVOID pv_value) -{ - XAPcmMixer *d = (XAPcmMixer *) p_xa_module_obj; - - /* ...check if command index is sane */ - XF_CHK_ERR(i_cmd < XA_MIXER_API_COMMANDS_NUM, XA_API_FATAL_INVALID_CMD); - - /* ...see if command is defined */ - XF_CHK_ERR(xa_mixer_api[i_cmd], XA_API_FATAL_INVALID_CMD); - - /* ...execute requested command */ - return xa_mixer_api[i_cmd](d, i_idx, pv_value); -} diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm-api.h b/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm-api.h deleted file mode 100644 index cb14dad0..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm-api.h +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-pcm-api.h - * - * Generic PCM format converter API - * - ******************************************************************************/ - -#ifndef __XA_PCM_API_H__ -#define __XA_PCM_API_H__ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xa_type_def.h" -#include "xa_error_standards.h" -#include "xa_apicmd_standards.h" -#include "xa_memory_standards.h" - -/******************************************************************************* - * Constants definitions - ******************************************************************************/ - -/* ...codec-specific configuration parameters */ -enum xa_config_param_pcm { - XA_PCM_CONFIG_PARAM_SAMPLE_RATE = 0, - XA_PCM_CONFIG_PARAM_IN_PCM_WIDTH = 1, - XA_PCM_CONFIG_PARAM_IN_CHANNELS = 2, - XA_PCM_CONFIG_PARAM_OUT_PCM_WIDTH = 3, - XA_PCM_CONFIG_PARAM_OUT_CHANNELS = 4, - XA_PCM_CONFIG_PARAM_CHANROUTING = 5, - XA_PCM_CONFIG_PARAM_NUM = 6, -}; - -/* ...component identifier (informative) */ -#define XA_CODEC_PCM 16 - -/******************************************************************************* - * Class 0: API Errors - ******************************************************************************/ - -#define XA_PCM_API_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_api, XA_CODEC_PCM, (e)) - -#define XA_PCM_API_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_api_pcm { - XA_PCM_API_NONFATAL_MAX = XA_PCM_API_NONFATAL(0) -}; - -enum xa_error_fatal_api_pcm { - XA_PCM_API_FATAL_MAX = XA_PCM_API_FATAL(0) -}; - -/******************************************************************************* - * Class 1: Configuration Errors - ******************************************************************************/ - -#define XA_PCM_CONFIG_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_PCM, (e)) - -#define XA_PCM_CONFIG_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_config_pcm { - XA_PCM_CONFIG_NONFATAL_RANGE = XA_PCM_CONFIG_NONFATAL(0), - XA_PCM_CONFIG_NONFATAL_STATE = XA_PCM_CONFIG_NONFATAL(1), - XA_PCM_CONFIG_NONFATAL_MAX = XA_PCM_CONFIG_NONFATAL(2) -}; - -enum xa_error_fatal_config_pcm { - XA_PCM_CONFIG_FATAL_RANGE = XA_PCM_CONFIG_FATAL(0), - XA_PCM_CONFIG_FATAL_MAX = XA_PCM_CONFIG_FATAL(1) -}; - -/******************************************************************************* - * Class 2: Execution Class Errors - ******************************************************************************/ - -#define XA_PCM_EXEC_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_PCM, (e)) - -#define XA_PCM_EXEC_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_execute_pcm { - XA_PCM_EXEC_NONFATAL_STATE = XA_PCM_EXEC_NONFATAL(0), - XA_PCM_EXEC_NONFATAL_NO_DATA = XA_PCM_EXEC_NONFATAL(1), - XA_PCM_EXEC_NONFATAL_INPUT = XA_PCM_EXEC_NONFATAL(2), - XA_PCM_EXEC_NONFATAL_OUTPUT = XA_PCM_EXEC_NONFATAL(3), - XA_PCM_EXEC_NONFATAL_MAX = XA_PCM_EXEC_NONFATAL(4) -}; - -enum xa_error_fatal_execute_pcm { - XA_PCM_EXEC_FATAL_STATE = XA_PCM_EXEC_FATAL(0), - XA_PCM_EXEC_FATAL_INPUT = XA_PCM_EXEC_FATAL(1), - XA_PCM_EXEC_FATAL_OUTPUT = XA_PCM_EXEC_FATAL(2), - XA_PCM_EXEC_FATAL_MAX = XA_PCM_EXEC_FATAL(3) -}; - -/******************************************************************************* - * API function definition - ******************************************************************************/ - -#if defined(USE_DLL) && defined(_WIN32) -#define DLL_SHARED __declspec(dllimport) -#elif defined (_WINDLL) -#define DLL_SHARED __declspec(dllexport) -#else -#define DLL_SHARED -#endif - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ -DLL_SHARED xa_codec_func_t xa_pcm_codec; -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* __XA_PCM_API_H__ */ - diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm.c b/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm.c deleted file mode 100644 index 43067144..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/pcm_proc/xa-pcm.c +++ /dev/null @@ -1,841 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-pcm.c - * - * PCM format converter plugin - * - ******************************************************************************/ - -#define MODULE_TAG PCM - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf-plugin.h" -#include "xa-audio-decoder-api.h" -#include "xa-pcm-api.h" - -#include <fcntl.h> - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(PROCESS, 0); - -/******************************************************************************* - * Local typedefs - ******************************************************************************/ - -/* ...API structure */ -typedef struct XAPcmCodec -{ - /* ...codec state */ - u32 state; - - /* ...sampling rate of input/output signal (informative only) */ - u32 sample_rate; - - /* ...number of input/output channels */ - u8 in_channels, out_channels; - - /* ...PCM sample width of input/output streams */ - u8 in_pcm_width, out_pcm_width; - - /* ...input/output stride size */ - u8 in_stride, out_stride; - - /* ...channel routing map between input and output */ - u32 chan_routing; - - /* ...data processing hook */ - XA_ERRORCODE (*process)(struct XAPcmCodec *); - - /* ...number of samples in input/output buffers */ - u32 insize, outsize; - - /* ...input/output memory indices */ - u32 input_idx, output_idx; - - /* ...input/output buffers passed from/to caller */ - void *input, *output; - - /* ...number of input bytes consumed/produced */ - u32 consumed, produced; - - /* ...debug - file handles */ - int f_input, f_output; - -} XAPcmCodec; - -/******************************************************************************* - * Local execution flags - ******************************************************************************/ - -#define XA_PCM_FLAG_PREINIT_DONE (1 << 0) -#define XA_PCM_FLAG_POSTINIT_DONE (1 << 1) -#define XA_PCM_FLAG_RUNNING (1 << 2) -#define XA_PCM_FLAG_EOS (1 << 3) -#define XA_PCM_FLAG_COMPLETE (1 << 4) - -/******************************************************************************* - * Local constants definitions - ******************************************************************************/ - -/* ...process at most 1024 samples per call */ -#define XA_PCM_MAX_SAMPLES 1024 - -/******************************************************************************* - * Internal processing functions - ******************************************************************************/ - -/* ...identity translation of PCM16/24 */ -static XA_ERRORCODE xa_pcm_do_execute_copy(XAPcmCodec *d) -{ - u32 n = d->insize; - u8 k = d->in_channels; - u32 length = n * k * (d->in_pcm_width == 16 ? 2 : 4); - s16 *input = d->input, *output = d->output; - - TRACE(PROCESS, _b("Copy PCM%d %p to %p (%u samples)"), d->in_pcm_width, input, output, n); - - /* ...check if we have all data setup */ - XF_CHK_ERR(input && n && output, XA_PCM_EXEC_FATAL_STATE); - - /* ...copy the samples without any processing */ - memcpy(output, input, length); - - /* ...set number of consumed/produced bytes */ - d->consumed = length; - d->produced = length; - - /* ...reset input buffer length */ - d->insize = 0; - - /* ...copy input to output */ - return XA_NO_ERROR; -} - -/* ...data processing for PCM16, channel mapping case */ -static XA_ERRORCODE xa_pcm_do_execute_pcm16_chmap(XAPcmCodec *d) -{ - u32 n = d->insize, i; - u8 k = d->in_channels, j; - u32 chmap = d->chan_routing, map; - s16 *input = d->input, *output = d->output; - u32 length = n * k * (d->in_pcm_width == 16 ? 2 : 4); - - TRACE(PROCESS, _b("Map PCM16 %p to %p (%u samples, map: %X)"), input, output, n, chmap); - - /* ...check if we have all data setup */ - XF_CHK_ERR(input && n && output, XA_PCM_EXEC_FATAL_STATE); - -#if 0 - /* ...convert individual samples (that function could be CPU-optimized - tbd) */ - for (i = 0; i < n; i++, input += k) - { - /* ...process individual channels in a sample */ - for (j = 0, map = chmap; j < k; j++, map >>= 4) - { - u8 m = map & 0xF; - - /* ...fill output channel (zero unused channel) */ - *output++ = (m < 8 ? input[m] : 0); - } - } - - /* ...set number of consumed/produced bytes */ - d->consumed = (u32)((u8 *)input - (u8 *)d->input); - d->produced = (u32)((u8 *)output - (u8 *)d->output); -#else - memcpy(output, input, length); - /* ...set number of consumed/produced bytes */ - d->consumed = length; - d->produced = length; -#endif - /* ...reset input buffer length */ - d->insize = 0; - - /* ...copy input to output */ - return XA_NO_ERROR; -} - -/* ...data processing for PCM24/PCM32, channel mapping case */ -static XA_ERRORCODE xa_pcm_do_execute_pcm24_chmap(XAPcmCodec *d) -{ - u32 n = d->insize, i; - u8 k = d->in_channels, j; - u32 chmap = d->chan_routing, map; - s32 *input = d->input, *output = d->output; - - TRACE(PROCESS, _b("Map PCM24 %p to %p (%u samples, map: %X)"), input, output, n, chmap); - - /* ...check if we have all data setup */ - XF_CHK_ERR(input && n && output, XA_PCM_EXEC_FATAL_STATE); - - /* ...convert individual samples (that function could be CPU-optimized - tbd) */ - for (i = 0; i < n; i++, input += k) - { - /* ...process individual channels in a sample */ - for (j = 0, map = chmap; j < k; j++, map >>= 4) - { - u8 m = map & 0xF; - - /* ...fill output channel (zero unused channel) */ - *output++ = (m < 8 ? input[m] : 0); - } - } - - /* ...set number of consumed/produced bytes */ - d->consumed = (u32)((u8 *)input - (u8 *)d->input); - d->produced = (u32)((u8 *)output - (u8 *)d->output); - - /* ...reset input buffer length */ - d->insize = 0; - - /* ...copy input to output */ - return XA_NO_ERROR; -} - -/* ...convert multichannel 24-bit PCM to 16-bit PCM with channel mapping */ -static XA_ERRORCODE xa_pcm_do_execute_pcm24_to_pcm16(XAPcmCodec *d) -{ - u32 n = d->insize, i; - u8 k = d->in_channels, j; - u32 chmap = d->chan_routing, map; - s32 *input = d->input; - s16 *output = d->output; - - TRACE(PROCESS, _b("Convert PCM24 %p to PCM16 %p (%u samples, map: %X)"), input, output, n, chmap); - - /* ...check if we have all data setup */ - XF_CHK_ERR(input && n && output, XA_PCM_EXEC_FATAL_STATE); - - /* ...convert individual samples (that function could be CPU-optimized - tbd) */ - for (i = 0; i < n; i++, input += k) - { - /* ...process individual channels in a sample */ - for (j = 0, map = chmap; j < k; j++, map >>= 4) - { - u8 m = map & 0xF; - - /* ...convert and zero out unused channels */ - *output++ = (m < 8 ? input[m] >> 16 : 0); - } - } - - /* ...set number of consumed/produced bytes */ - d->consumed = (u32)((u8 *)input - (u8 *)d->input); - d->produced = (u32)((u8 *)output - (u8 *)d->output); - - /* ...dump output data */ - //BUG(write(d->f_input, d->input, d->consumed) != d->consumed, _x("%m")); - //BUG(write(d->f_output, d->output, d->produced) != d->produced, _x("%m")); - - /* ...reset input buffer length (tbd - need that?) */ - d->insize = 0; - - /* ...copy input to output */ - return XA_NO_ERROR; -} - -/* ...convert multichannel 16-bit PCM to 24-bit PCM with channel mapping */ -static XA_ERRORCODE xa_pcm_do_execute_pcm16_to_pcm24(XAPcmCodec *d) -{ - u32 n = d->insize, i; - u8 k = d->in_channels, j; - u32 chmap = d->chan_routing, map; - s16 *input = d->input; - s32 *output = d->output; - - TRACE(PROCESS, _b("Convert PCM16 %p to PCM24 %p (%u samples, map: %X)"), input, output, n, chmap); - - /* ...check if we have all data setup */ - XF_CHK_ERR(input && n && output, XA_PCM_EXEC_FATAL_STATE); - - /* ...convert individual samples (that function could be CPU-optimized - tbd) */ - for (i = 0; i < n; i++, input += k) - { - /* ...process individual channels in a sample */ - for (j = 0, map = chmap; j < k; j++, map >>= 4) - { - u8 m = map & 0xF; - - /* ...convert and zero out unused channels */ - *output++ = (m < 8 ? input[m] << 16 : 0); - } - } - - /* ...set number of consumed/produced bytes */ - d->consumed = (u32)((u8 *)input - (u8 *)d->input); - d->produced = (u32)((u8 *)output - (u8 *)d->output); - - /* ...reset input buffer length (tbd - need that?) */ - d->insize = 0; - - /* ...copy input to output */ - return XA_NO_ERROR; -} - -/* ...determine if we need to do a channel routing */ -static inline int xa_pcm_is_identity_mapping(u32 chmap, u8 k) -{ - u8 j; - - for (j = 0; j < k; j++, chmap >>= 4) - if ((chmap & 0xF) != j) - return 0; - - return 1; -} - -/* ...runtime initialization */ -static inline XA_ERRORCODE xa_pcm_do_runtime_init(XAPcmCodec *d) -{ - u8 in_width = d->in_pcm_width, out_width = d->out_pcm_width; - u8 in_ch = d->in_channels, out_ch = d->out_channels; - u32 chmap = d->chan_routing; - - /* ...check for supported processing schemes */ - if (in_width == out_width) - { - /* ...check if we need to do a channel mapping */ - if (in_ch != out_ch || !xa_pcm_is_identity_mapping(chmap, in_ch)) - { - /* ...mapping is needed */ - d->process = (in_width == 16 ? xa_pcm_do_execute_pcm16_chmap : xa_pcm_do_execute_pcm24_chmap); - } - else - { - /* ...setup identity translation */ - d->process = xa_pcm_do_execute_copy; - } - } - else - { - /* ...samples converion is required */ - d->process = (in_width == 16 ? xa_pcm_do_execute_pcm16_to_pcm24 : xa_pcm_do_execute_pcm24_to_pcm16); - } - - /* ...mark the runtime initialization is completed */ - d->state = XA_PCM_FLAG_PREINIT_DONE | XA_PCM_FLAG_POSTINIT_DONE | XA_PCM_FLAG_RUNNING; - - TRACE(INIT, _b("PCM format converter initialized: PCM%u -> PCM%u, ich=%u, och=%u, map=%X"), in_width, out_width, in_ch, out_ch, chmap); - - return XA_NO_ERROR; -} - -/******************************************************************************* - * Commands processing - ******************************************************************************/ - -/* ...standard codec initialization routine */ -static XA_ERRORCODE xa_pcm_get_api_size(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...return API structure size */ - *(WORD32 *)pv_value = sizeof(*d); - - return XA_NO_ERROR; -} - -/* ...standard codec initialization routine */ -static XA_ERRORCODE xa_pcm_init(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...process particular initialization type */ - switch (i_idx) - { - case XA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS: - { - /* ...pre-configuration initialization; reset internal data */ - memset(d, 0, sizeof(*d)); - - /* ...set default parameters */ - d->in_pcm_width = d->out_pcm_width = 16; - d->in_channels = d->out_channels = 2; - d->chan_routing = (0 << 0) | (1 << 1); - d->sample_rate = 48000; - - /* ...open debug files */ - //BUG((d->f_input = open("pcm-in.dat", O_WRONLY | O_CREAT, 0664)) < 0, _x("%m")); - //BUG((d->f_output = open("pcm-out.dat", O_WRONLY | O_CREAT, 0664)) < 0, _x("%m")); - - /* ...mark pre-initialization is done */ - d->state = XA_PCM_FLAG_PREINIT_DONE; - - return XA_NO_ERROR; - } - - case XA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS: - { - /* ...post-configuration initialization (all parameters are set) */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...calculate input sample stride size */ - d->in_stride = d->in_channels * (d->in_pcm_width == 16 ? 2 : 4); - d->out_stride = d->out_channels * (d->out_pcm_width == 16 ? 2 : 4); - - /* ...mark post-initialization is complete */ - d->state |= XA_PCM_FLAG_POSTINIT_DONE; - - return XA_NO_ERROR; - } - - case XA_CMD_TYPE_INIT_PROCESS: - { - /* ...run-time initialization process; make sure post-init is complete */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...initialize runtime for specified transformation function */ - return xa_pcm_do_runtime_init(d); - } - - case XA_CMD_TYPE_INIT_DONE_QUERY: - { - /* ...check for runtime initialization completion; maske usre post-init is complete */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...put current status */ - *(WORD32 *)pv_value = (d->state & XA_PCM_FLAG_RUNNING ? 1 : 0); - - return XA_NO_ERROR; - } - - default: - /* ...unrecognized command */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...set configuration parameter */ -static XA_ERRORCODE xa_pcm_set_config_param(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - WORD32 i_value; - - /* ...sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...configuration is allowed only in PRE-CONFIG state */ - XF_CHK_ERR(d->state == XA_PCM_FLAG_PREINIT_DONE, XA_PCM_CONFIG_NONFATAL_STATE); - - /* ...get integer parameter value */ - i_value = *(WORD32 *)pv_value; - - /* ...process individual configuration parameter */ - switch (i_idx) - { - case XA_CODEC_CONFIG_PARAM_SAMPLE_RATE: - case XA_PCM_CONFIG_PARAM_SAMPLE_RATE: - /* ...accept any sampling rate */ - d->sample_rate = (u32)i_value; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_IN_PCM_WIDTH: - /* ...return input sample bit-width */ - XF_CHK_ERR(i_value == 16 || i_value == 24, XA_PCM_CONFIG_NONFATAL_RANGE); - d->in_pcm_width = (u8)i_value; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_IN_CHANNELS: - /* ...support at most 8-channels stream */ - XF_CHK_ERR(i_value > 0 && i_value <= 8, XA_PCM_CONFIG_NONFATAL_RANGE); - d->in_channels = (u8)i_value; - return XA_NO_ERROR; - - case XA_CODEC_CONFIG_PARAM_PCM_WIDTH: - case XA_PCM_CONFIG_PARAM_OUT_PCM_WIDTH: - /* ...we only support PCM16 and PCM24 */ - XF_CHK_ERR(i_value == 16 || i_value == 24, XA_PCM_CONFIG_NONFATAL_RANGE); - d->out_pcm_width = (u8)i_value; - return XA_NO_ERROR; - - case XA_CODEC_CONFIG_PARAM_CHANNELS: - case XA_PCM_CONFIG_PARAM_OUT_CHANNELS: - /* ...support at most 8-channels stream */ - XF_CHK_ERR(i_value > 0 && i_value <= 8, XA_API_FATAL_INVALID_CMD_TYPE); - d->out_channels = (u8)i_value; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_CHANROUTING: - /* ...accept any channel routing mask */ - d->chan_routing = (u32)i_value; - return XA_NO_ERROR; - - default: - /* ...unrecognized parameter */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...retrieve configuration parameter */ -static XA_ERRORCODE xa_pcm_get_config_param(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...make sure pre-configuration is completed */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_PREINIT_DONE, XA_PCM_CONFIG_NONFATAL_STATE); - - /* ...process individual parameter */ - switch (i_idx) - { - case XA_CODEC_CONFIG_PARAM_SAMPLE_RATE: - case XA_PCM_CONFIG_PARAM_SAMPLE_RATE: - /* ...return output sampling frequency */ - *(WORD32 *)pv_value = d->sample_rate; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_IN_PCM_WIDTH: - /* ...return input sample bit-width */ - *(WORD32 *)pv_value = d->in_pcm_width; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_IN_CHANNELS: - /* ...return number of input channels */ - *(WORD32 *)pv_value = d->in_channels; - return XA_NO_ERROR; - - case XA_CODEC_CONFIG_PARAM_PCM_WIDTH: - case XA_PCM_CONFIG_PARAM_OUT_PCM_WIDTH: - /* ...return output sample bit-width */ - *(WORD32 *)pv_value = d->out_pcm_width; - return XA_NO_ERROR; - - case XA_CODEC_CONFIG_PARAM_CHANNELS: - case XA_PCM_CONFIG_PARAM_OUT_CHANNELS: - /* ...return number of output channels */ - *(WORD32 *)pv_value = d->out_channels; - return XA_NO_ERROR; - - case XA_PCM_CONFIG_PARAM_CHANROUTING: - /* ...return current channel routing mask */ - *(WORD32 *)pv_value = d->chan_routing; - return XA_NO_ERROR; - - default: - /* ...unrecognized parameter */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...execution command */ -static XA_ERRORCODE xa_pcm_execute(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be in running state */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_RUNNING, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...process individual command type */ - switch (i_idx) - { - case XA_CMD_TYPE_DO_EXECUTE: - /* ...do data processing (tbd - result code is bad) */ - if (d->insize != 0) - { - XF_CHK_ERR(!XA_ERROR_SEVERITY(d->process(d)), XA_PCM_EXEC_FATAL_STATE); - } - - /* ...process end-of-stream condition */ - (d->state & XA_PCM_FLAG_EOS ? d->state ^= XA_PCM_FLAG_EOS | XA_PCM_FLAG_COMPLETE : 0); - - return XA_NO_ERROR; - - case XA_CMD_TYPE_DONE_QUERY: - /* ...check if processing is complete */ - XF_CHK_ERR(pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...return completion status */ - *(WORD32 *)pv_value = (d->state & XA_PCM_FLAG_COMPLETE ? 1 : 0); - - return XA_NO_ERROR; - - case XA_CMD_TYPE_DO_RUNTIME_INIT: - /* ...reset codec operation */ - return xa_pcm_do_runtime_init(d); - - default: - /* ...unrecognized command */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...set number of input bytes */ -static XA_ERRORCODE xa_pcm_set_input_bytes(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - u32 in_stride = d->in_stride; - u32 insize; - - /* ...sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...track index must be valid */ - XF_CHK_ERR(i_idx == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...component must be initialized */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...input buffer must exist */ - XF_CHK_ERR(d->input, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...convert bytes into samples (don't like division, but still...) */ - insize = *(WORD32 *)pv_value / in_stride; - - /* ...make sure we have integral amount of samples */ - XF_CHK_ERR(*(WORD32 *)pv_value == insize * in_stride, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...limit input buffer size to maximal value*/ - d->insize = (insize > XA_PCM_MAX_SAMPLES ? XA_PCM_MAX_SAMPLES : insize); - - return XA_NO_ERROR; -} - -/* ...get number of output bytes produced */ -static XA_ERRORCODE xa_pcm_get_output_bytes(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...buffer index must be sane */ - XF_CHK_ERR(i_idx == 1, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...component must be initialized */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...output buffer must exist */ - XF_CHK_ERR(d->output, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...return number of produced bytes (and reset instantly? - tbd) */ - *(WORD32 *)pv_value = d->produced; - - return XA_NO_ERROR; -} - -/* ...get number of consumed bytes */ -static XA_ERRORCODE xa_pcm_get_curidx_input_buf(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...index must be valid */ - XF_CHK_ERR(i_idx == 0, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...input buffer must exist */ - XF_CHK_ERR(d->input, XA_PCM_EXEC_NONFATAL_INPUT); - - /* ...return number of bytes consumed */ - *(WORD32 *)pv_value = d->consumed; - - return XA_NO_ERROR; -} - -/* ...end-of-stream processing */ -static XA_ERRORCODE xa_pcm_input_over(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...sanity check */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...put end-of-stream flag */ - d->state |= XA_PCM_FLAG_EOS; - - TRACE(PROCESS, _b("Input-over-condition signalled")); - - return XA_NO_ERROR; -} - -/* ..get total amount of data for memory tables */ -static XA_ERRORCODE xa_pcm_get_memtabs_size(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity checks */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check mixer is pre-initialized */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_PREINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...we have all our tables inside API structure */ - *(WORD32 *)pv_value = 0; - - return XA_NO_ERROR; -} - -/* ...return total amount of memory buffers */ -static XA_ERRORCODE xa_pcm_get_n_memtabs(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity checks */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...we have 1 input buffer and 1 output buffer */ - *(WORD32 *)pv_value = 1 + 1; - - return XA_NO_ERROR; -} - -/* ...return memory type data */ -static XA_ERRORCODE xa_pcm_get_mem_info_type(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be in post-init state */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...check buffer type */ - switch (i_idx) - { - case 0: - *(WORD32 *)pv_value = XA_MEMTYPE_INPUT; - return XA_NO_ERROR; - - case 1: - *(WORD32 *)pv_value = XA_MEMTYPE_OUTPUT; - return XA_NO_ERROR; - - default: - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...return memory buffer size */ -static XA_ERRORCODE xa_pcm_get_mem_info_size(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be in post-init state */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...determine particular buffer */ - switch (i_idx) - { - case 0: - /* ...input buffer size can be any */ - *(WORD32 *)pv_value = 0; - return XA_NO_ERROR; - - case 1: - /* ...output buffer size is dependent on stride */ - *(WORD32 *)pv_value = XA_PCM_MAX_SAMPLES * d->out_stride; - return XA_NO_ERROR; - - default: - /* ...invalid buffer index */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/* ...return memory alignment data */ -static XA_ERRORCODE xa_pcm_get_mem_info_alignment(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d && pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be in post-initialization state */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...all buffers are 4-bytes aligned */ - *(WORD32 *)pv_value = 4; - - return XA_NO_ERROR; -} - -/* ...set memory pointer */ -static XA_ERRORCODE xa_pcm_set_mem_ptr(XAPcmCodec *d, WORD32 i_idx, pVOID pv_value) -{ - /* ...basic sanity check */ - XF_CHK_ERR(d, XA_API_FATAL_INVALID_CMD_TYPE); - XF_CHK_ERR(pv_value, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...codec must be in post-initialized state */ - XF_CHK_ERR(d->state & XA_PCM_FLAG_POSTINIT_DONE, XA_API_FATAL_INVALID_CMD_TYPE); - - /* ...select memory buffer */ - switch (i_idx) - { - case 0: - /* ...input buffer */ - d->input = pv_value; - return XA_NO_ERROR; - - case 1: - /* ...output buffer */ - d->output = pv_value; - return XA_NO_ERROR; - - default: - /* ...invalid index */ - return XF_CHK_ERR(0, XA_API_FATAL_INVALID_CMD_TYPE); - } -} - -/******************************************************************************* - * API command hooks - ******************************************************************************/ - -static XA_ERRORCODE (* const xa_pcm_api[])(XAPcmCodec *, WORD32, pVOID) = -{ - [XA_API_CMD_GET_API_SIZE] = xa_pcm_get_api_size, - - [XA_API_CMD_INIT] = xa_pcm_init, - [XA_API_CMD_SET_CONFIG_PARAM] = xa_pcm_set_config_param, - [XA_API_CMD_GET_CONFIG_PARAM] = xa_pcm_get_config_param, - - [XA_API_CMD_EXECUTE] = xa_pcm_execute, - [XA_API_CMD_SET_INPUT_BYTES] = xa_pcm_set_input_bytes, - [XA_API_CMD_GET_OUTPUT_BYTES] = xa_pcm_get_output_bytes, - [XA_API_CMD_GET_CURIDX_INPUT_BUF] = xa_pcm_get_curidx_input_buf, - [XA_API_CMD_INPUT_OVER] = xa_pcm_input_over, - - [XA_API_CMD_GET_MEMTABS_SIZE] = xa_pcm_get_memtabs_size, - [XA_API_CMD_GET_N_MEMTABS] = xa_pcm_get_n_memtabs, - [XA_API_CMD_GET_MEM_INFO_TYPE] = xa_pcm_get_mem_info_type, - [XA_API_CMD_GET_MEM_INFO_SIZE] = xa_pcm_get_mem_info_size, - [XA_API_CMD_GET_MEM_INFO_ALIGNMENT] = xa_pcm_get_mem_info_alignment, - [XA_API_CMD_SET_MEM_PTR] = xa_pcm_set_mem_ptr, -}; - -/* ...total numer of commands supported */ -#define XA_PCM_API_COMMANDS_NUM (sizeof(xa_pcm_api) / sizeof(xa_pcm_api[0])) - -/******************************************************************************* - * API entry point - ******************************************************************************/ - -XA_ERRORCODE xa_pcm_codec(xa_codec_handle_t p_xa_module_obj, WORD32 i_cmd, WORD32 i_idx, pVOID pv_value) -{ - XAPcmCodec *d = (XAPcmCodec *) p_xa_module_obj; - - /* ...check if command index is sane */ - XF_CHK_ERR(i_cmd < XA_PCM_API_COMMANDS_NUM, XA_API_FATAL_INVALID_CMD); - - /* ...see if command is defined */ - XF_CHK_ERR(xa_pcm_api[i_cmd], XA_API_FATAL_INVALID_CMD); - - /* ...execute requested command */ - return xa_pcm_api[i_cmd](d, i_idx, pv_value); -} diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a b/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a Binary files differdeleted file mode 100644 index cb284459..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/lib/hifi3/xa_vorbis_dec.a +++ /dev/null diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa-vorbis-decoder.c b/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa-vorbis-decoder.c deleted file mode 100644 index 43220ef3..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa-vorbis-decoder.c +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xa-vorbis-decoder.c - * - * VORBIS decoder plugin - thin wrapper around VORBISDEC library - * - ******************************************************************************/ - -#define MODULE_TAG VORBISDEC - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf-plugin.h" -#include "audio/xa-audio-decoder-api.h" -#include "xa_vorbis_dec_api.h" - -/******************************************************************************* - * Override GET-CONFIG-PARAM function - ******************************************************************************/ - -static inline XA_ERRORCODE xa_vorbis_get_config_param(xa_codec_handle_t handle, WORD32 i_idx, pVOID pv_value) -{ - /* ...translate "standard" parameter index into internal value */ - switch (i_idx) - { - case XA_CODEC_CONFIG_PARAM_CHANNELS: - /* ...return number of output channels */ - i_idx = XA_VORBISDEC_CONFIG_PARAM_NUM_CHANNELS; - break; - - case XA_CODEC_CONFIG_PARAM_SAMPLE_RATE: - /* ...return output sampling frequency */ - i_idx = XA_VORBISDEC_CONFIG_PARAM_SAMP_FREQ; - break; - - case XA_CODEC_CONFIG_PARAM_PCM_WIDTH: - /* ...return sample bit-width */ - i_idx = XA_VORBISDEC_CONFIG_PARAM_PCM_WDSZ; - break; - } - - /* ...pass to library */ - return xa_vorbis_dec(handle, XA_API_CMD_GET_CONFIG_PARAM, i_idx, pv_value); -} - -/******************************************************************************* - * API entry point - ******************************************************************************/ - -XA_ERRORCODE xa_vorbis_decoder(xa_codec_handle_t p_xa_module_obj, WORD32 i_cmd, WORD32 i_idx, pVOID pv_value) -{ - /* ...process common audio-decoder commands */ - if (i_cmd == XA_API_CMD_GET_CONFIG_PARAM) - { - return xa_vorbis_get_config_param(p_xa_module_obj, i_idx, pv_value); - } - else - { - return xa_vorbis_dec(p_xa_module_obj, i_cmd, i_idx, pv_value); - } -} diff --git a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa_vorbis_dec_api.h b/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa_vorbis_dec_api.h deleted file mode 100644 index f99660f8..00000000 --- a/hifi/xaf/hifi-dpf/plugins/cadence/vorbis_dec/xa_vorbis_dec_api.h +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - - -#ifndef __XA_VORBIS_DEC_API_H__ -#define __XA_VORBIS_DEC_API_H__ - -#include <xa_memory_standards.h> - -/* vorbis_dec-specific configuration parameters */ -enum xa_config_param_vorbis_dec -{ - XA_VORBISDEC_CONFIG_PARAM_SAMP_FREQ = 0, - XA_VORBISDEC_CONFIG_PARAM_NUM_CHANNELS = 1, - XA_VORBISDEC_CONFIG_PARAM_PCM_WDSZ = 2, - XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_PTR = 3, - XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_SIZE = 4, - XA_VORBISDEC_CONFIG_PARAM_GET_CUR_BITRATE = 5, - XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_FILE_MODE = 6, - XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_LAST_PKT_GRANULE_POS = 7, - XA_VORBISDEC_CONFIG_PARAM_OGG_MAX_PAGE_SIZE = 8, - XA_VORBISDEC_CONFIG_PARAM_RUNTIME_MEM = 9 -}; - -/* commands */ -#include <xa_apicmd_standards.h> - -/* vorbis_dec-specific command types */ -/* (none) */ - -/* error codes */ -#include <xa_error_standards.h> -#define XA_CODEC_VORBIS_DEC 7 - -/* vorbis_dec-specific error codes */ - -/*****************************************************************************/ -/* Class 1: Configuration Errors */ -/*****************************************************************************/ -/* Nonfatal Errors */ -enum xa_error_nonfatal_config_vorbis_dec -{ - XA_VORBISDEC_CONFIG_NONFATAL_GROUPED_STREAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_CONFIG_NONFATAL_BAD_PARAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1) -}; - -/* Fatal Errors */ -enum xa_error_fatal_config_vorbis_dec -{ - XA_VORBISDEC_CONFIG_FATAL_BADHDR = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_CONFIG_FATAL_NOTVORBIS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_CONFIG_FATAL_BADINFO = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_CONFIG_FATAL_BADVERSION = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 3), - XA_VORBISDEC_CONFIG_FATAL_BADBOOKS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 4), - XA_VORBISDEC_CONFIG_FATAL_CODEBOOK_DECODE = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 5), - XA_VORBISDEC_CONFIG_FATAL_INVALID_PARAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 6) -}; - -/*****************************************************************************/ -/* Class 2: Execution Errors */ -/*****************************************************************************/ -/* Nonfatal Errors */ -enum xa_error_nonfatal_execute_vorbis_dec -{ - XA_VORBISDEC_EXECUTE_NONFATAL_OV_HOLE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_NOTAUDIO = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_BADPACKET = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_RUNTIME_DECODE_FLUSH_IN_PROGRESS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_INVALID_STRM_POS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 4), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_INSUFFICIENT_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 5), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_IDENT_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 6), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_HEADER_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 7) -}; -/* Fatal Errors */ -enum xa_error_fatal_execute_vorbis_dec -{ - XA_VORBISDEC_EXECUTE_FATAL_PERSIST_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_EXECUTE_FATAL_SCRATCH_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_EXECUTE_FATAL_CORRUPT_STREAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_EXECUTE_FATAL_INSUFFICIENT_INP_BUF_SIZE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3) -}; - -#include "xa_type_def.h" - -#ifdef __cplusplus - extern "C" { -#endif /* __cplusplus */ - - xa_codec_func_t xa_vorbis_dec; - -#ifdef __cplusplus - } -#endif /* __cplusplus */ - -#endif /* __XA_VORBIS_DEC_API_H__ */ diff --git a/hifi/xaf/host-apf/Android.mk b/hifi/xaf/host-apf/Android.mk deleted file mode 100644 index 2bce8cf0..00000000 --- a/hifi/xaf/host-apf/Android.mk +++ /dev/null @@ -1,71 +0,0 @@ -LOCAL_PATH := $(call my-dir) -################################################################################ -# libxtensa_proxy library building -################################################################################ - -include $(CLEAR_VARS) -LOCAL_VENDOR_MODULE := true -common_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/include/audio \ - $(LOCAL_PATH)/include/os/android \ - $(LOCAL_PATH)/include/sys/fio \ - $(LOCAL_PATH)/playback \ - $(LOCAL_PATH)/playback/tinyalsa \ - $(LOCAL_PATH)/utest/include - -LOCAL_SRC_FILES := \ - proxy/xf-proxy.c \ - proxy/xaf-api.c \ - proxy/xf-trace.c \ - proxy/xf-fio.c \ - playback/xa_playback.c \ - playback/tinyalsa/pcm.c \ - utest/xaf-utils-test.c \ - utest/xaf-mem-test.c - -C_FLAGS := -DXF_TRACE=0 -Wall -Werror -Wno-everything - -LOCAL_SHARED_LIBRARIES := liblog -LOCAL_C_INCLUDES := $(common_C_INCLUDES) -LOCAL_C_INCLUDES += external/expat/lib -LOCAL_CFLAGS := $(C_FLAGS) -LOCAL_MODULE := libxtensa_proxy -LOCAL_MODULE_TAGS := optional - -include $(BUILD_STATIC_LIBRARY) - -################################################################################ -# xaf-dec-test: fileinput->ogg/pcm decoder->speaker output -################################################################################ -include $(CLEAR_VARS) -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE := xaf-dec-test - -LOCAL_SRC_FILES := \ - utest/xaf-dec-test.c - -LOCAL_C_INCLUDES := $(common_C_INCLUDES) -LOCAL_CFLAGS := $(C_FLAGS) -LOCAL_STATIC_LIBRARIES := libxtensa_proxy -LOCAL_SHARED_LIBRARIES := liblog libcutils -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) - -################################################################################ -# xaf-dec-mix-test: fileinput->ogg orpcm decoder->Mixer->speaker output -################################################################################ -include $(CLEAR_VARS) -LOCAL_VENDOR_MODULE := true -LOCAL_MODULE := xaf-dec-mix-test - -LOCAL_SRC_FILES := \ - utest/xaf-dec-mix-test.c - -LOCAL_C_INCLUDES := $(common_C_INCLUDES) -LOCAL_CFLAGS := $(C_FLAGS) -LOCAL_STATIC_LIBRARIES := libxtensa_proxy -LOCAL_SHARED_LIBRARIES := liblog libcutils -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) - diff --git a/hifi/xaf/host-apf/include/audio/xa-audio-decoder-api.h b/hifi/xaf/host-apf/include/audio/xa-audio-decoder-api.h deleted file mode 100644 index f82544c8..00000000 --- a/hifi/xaf/host-apf/include/audio/xa-audio-decoder-api.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XA_ADEC_API_H__ -#define __XA_ADEC_API_H__ - -/* ...generic audio-decoder configuration parameters */ -enum xa_config_param_codec { - XA_CODEC_CONFIG_PARAM_CHANNELS = 0x10000 + 0, - XA_CODEC_CONFIG_PARAM_SAMPLE_RATE = 0x10000 + 1, - XA_CODEC_CONFIG_PARAM_PCM_WIDTH = 0x10000 + 2, - XA_CODEC_CONFIG_PARAM_PRODUCED = 0x10000 + 3 -}; - -/* ...ports indices */ -enum xa_codec_ports { - XA_CODEC_INPUT_PORT = 0, - XA_CODEC_OUTPUT_PORT = 1 -}; - -/* ...non-fatal execution errors */ -enum -{ - XA_CODEC_EXEC_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_GENERIC, 0) -}; - -#endif diff --git a/hifi/xaf/host-apf/include/audio/xa-mixer-api.h b/hifi/xaf/host-apf/include/audio/xa-mixer-api.h deleted file mode 100644 index c9695b40..00000000 --- a/hifi/xaf/host-apf/include/audio/xa-mixer-api.h +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XA_MIXER_API_H__ -#define __XA_MIXER_API_H__ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...generic commands */ -#include "xa_apicmd_standards.h" - -/* ...generic error codes */ -#include "xa_error_standards.h" - -/* ...common types */ -#include "xa_type_def.h" - -/******************************************************************************* - * Constants definitions - ******************************************************************************/ - -/* ...mixer-specific configuration parameters */ -enum xa_config_param_mixer { - XA_MIXER_CONFIG_PARAM_INPUT_TRACKS = 0, - XA_MIXER_CONFIG_PARAM_PCM_WIDTH = 1, - XA_MIXER_CONFIG_PARAM_CHANNELS = 2, - XA_MIXER_CONFIG_PARAM_SAMPLE_RATE = 4, - XA_MIXER_CONFIG_PARAM_FRAME_SIZE = 5, - XA_MIXER_CONFIG_PARAM_BUFFER_SIZE = 6, - XA_MIXER_CONFIG_PARAM_VOLUME = 7, - XA_MIXER_CONFIG_PARAM_NUM = 8 -}; - -/* ...component identifier (informative) */ -#define XA_CODEC_MIXER 1 - -/* ...global limitation - maximal mixer track number */ -#define XA_MIXER_MAX_TRACK_NUMBER 4 - -/* ...volume representation */ -#define __XA_MIXER_VOLUME(v) \ - ({ u32 __v = (u32)((v) * (1 << 12)); (__v > 0xFFFF ? __v = 0xFFFF : 0); (u16)__v; }) - -/* ...mixer volume setting command encoding */ -#define XA_MIXER_VOLUME(track, channel, volume) \ - (__XA_MIXER_VOLUME(volume) | ((track) << 16) | ((channel) << 20)) - -/******************************************************************************* - * Class 0: API Errors - ******************************************************************************/ - -#define XA_MIXER_API_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_api, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_API_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_api_mixer { - XA_MIXER_API_NONFATAL_MAX = XA_MIXER_API_NONFATAL(0) -}; - -enum xa_error_fatal_api_mixer { - XA_MIXER_API_FATAL_MAX = XA_MIXER_API_FATAL(0) -}; - -/******************************************************************************* - * Class 1: Configuration Errors - ******************************************************************************/ - -#define XA_MIXER_CONFIG_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_CONFIG_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_config_mixer { - XA_MIXER_CONFIG_NONFATAL_RANGE = XA_MIXER_CONFIG_NONFATAL(0), - XA_MIXER_CONFIG_NONFATAL_STATE = XA_MIXER_CONFIG_NONFATAL(1), - XA_MIXER_CONFIG_NONFATAL_MAX = XA_MIXER_CONFIG_NONFATAL(2) -}; - -enum xa_error_fatal_config_mixer { - XA_MIXER_CONFIG_FATAL_RANGE = XA_MIXER_CONFIG_FATAL(0), - XA_MIXER_CONFIG_FATAL_TRACK_STATE = XA_MIXER_CONFIG_FATAL(0 + XA_MIXER_CONFIG_NONFATAL_MAX), - XA_MIXER_CONFIG_FATAL_MAX = XA_MIXER_CONFIG_FATAL(1) -}; - -/******************************************************************************* - * Class 2: Execution Class Errors - ******************************************************************************/ - -#define XA_MIXER_EXEC_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_MIXER, (e)) - -#define XA_MIXER_EXEC_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_MIXER, (e)) - -enum xa_error_nonfatal_execute_mixer { - XA_MIXER_EXEC_NONFATAL_STATE = XA_MIXER_EXEC_NONFATAL(0), - XA_MIXER_EXEC_NONFATAL_NO_DATA = XA_MIXER_EXEC_NONFATAL(1), - XA_MIXER_EXEC_NONFATAL_INPUT = XA_MIXER_EXEC_NONFATAL(2), - XA_MIXER_EXEC_NONFATAL_OUTPUT = XA_MIXER_EXEC_NONFATAL(3), - XA_MIXER_EXEC_NONFATAL_MAX = XA_MIXER_EXEC_NONFATAL(4) -}; - -enum xa_error_fatal_execute_mixer { - XA_MIXER_EXEC_FATAL_STATE = XA_MIXER_EXEC_FATAL(0), - XA_MIXER_EXEC_FATAL_INPUT = XA_MIXER_EXEC_FATAL(1), - XA_MIXER_EXEC_FATAL_OUTPUT = XA_MIXER_EXEC_FATAL(2), - XA_MIXER_EXEC_FATAL_MAX = XA_MIXER_EXEC_FATAL(3) -}; - -/******************************************************************************* - * API function definition (tbd) - ******************************************************************************/ - -#if defined(USE_DLL) && defined(_WIN32) -#define DLL_SHARED __declspec(dllimport) -#elif defined (_WINDLL) -#define DLL_SHARED __declspec(dllexport) -#else -#define DLL_SHARED -#endif - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ -DLL_SHARED xa_codec_func_t xa_mixer; -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* __XA_MIXER_API_H__ */ diff --git a/hifi/xaf/host-apf/include/audio/xa-pcm-api.h b/hifi/xaf/host-apf/include/audio/xa-pcm-api.h deleted file mode 100644 index 94fb1362..00000000 --- a/hifi/xaf/host-apf/include/audio/xa-pcm-api.h +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XA_PCM_API_H__ -#define __XA_PCM_API_H__ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xa_type_def.h" -#include "xa_error_standards.h" -#include "xa_apicmd_standards.h" -#include "xa_memory_standards.h" - -/******************************************************************************* - * Constants definitions - ******************************************************************************/ - -/* ...codec-specific configuration parameters */ -enum xa_config_param_pcm { - XA_PCM_CONFIG_PARAM_SAMPLE_RATE = 0, - XA_PCM_CONFIG_PARAM_IN_PCM_WIDTH = 1, - XA_PCM_CONFIG_PARAM_IN_CHANNELS = 2, - XA_PCM_CONFIG_PARAM_OUT_PCM_WIDTH = 3, - XA_PCM_CONFIG_PARAM_OUT_CHANNELS = 4, - XA_PCM_CONFIG_PARAM_CHANROUTING = 5, - XA_PCM_CONFIG_PARAM_NUM = 6, -}; - -/* ...component identifier (informative) */ -#define XA_CODEC_PCM 16 - -/******************************************************************************* - * Class 0: API Errors - ******************************************************************************/ - -#define XA_PCM_API_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_api, XA_CODEC_PCM, (e)) - -#define XA_PCM_API_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_api_pcm { - XA_PCM_API_NONFATAL_MAX = XA_PCM_API_NONFATAL(0) -}; - -enum xa_error_fatal_api_pcm { - XA_PCM_API_FATAL_MAX = XA_PCM_API_FATAL(0) -}; - -/******************************************************************************* - * Class 1: Configuration Errors - ******************************************************************************/ - -#define XA_PCM_CONFIG_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_PCM, (e)) - -#define XA_PCM_CONFIG_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_config_pcm { - XA_PCM_CONFIG_NONFATAL_RANGE = XA_PCM_CONFIG_NONFATAL(0), - XA_PCM_CONFIG_NONFATAL_STATE = XA_PCM_CONFIG_NONFATAL(1), - XA_PCM_CONFIG_NONFATAL_MAX = XA_PCM_CONFIG_NONFATAL(2) -}; - -enum xa_error_fatal_config_pcm { - XA_PCM_CONFIG_FATAL_RANGE = XA_PCM_CONFIG_FATAL(0), - XA_PCM_CONFIG_FATAL_MAX = XA_PCM_CONFIG_FATAL(1) -}; - -/******************************************************************************* - * Class 2: Execution Class Errors - ******************************************************************************/ - -#define XA_PCM_EXEC_NONFATAL(e) \ - XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_PCM, (e)) - -#define XA_PCM_EXEC_FATAL(e) \ - XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_PCM, (e)) - -enum xa_error_nonfatal_execute_pcm { - XA_PCM_EXEC_NONFATAL_STATE = XA_PCM_EXEC_NONFATAL(0), - XA_PCM_EXEC_NONFATAL_NO_DATA = XA_PCM_EXEC_NONFATAL(1), - XA_PCM_EXEC_NONFATAL_INPUT = XA_PCM_EXEC_NONFATAL(2), - XA_PCM_EXEC_NONFATAL_OUTPUT = XA_PCM_EXEC_NONFATAL(3), - XA_PCM_EXEC_NONFATAL_MAX = XA_PCM_EXEC_NONFATAL(4) -}; - -enum xa_error_fatal_execute_pcm { - XA_PCM_EXEC_FATAL_STATE = XA_PCM_EXEC_FATAL(0), - XA_PCM_EXEC_FATAL_INPUT = XA_PCM_EXEC_FATAL(1), - XA_PCM_EXEC_FATAL_OUTPUT = XA_PCM_EXEC_FATAL(2), - XA_PCM_EXEC_FATAL_MAX = XA_PCM_EXEC_FATAL(3) -}; - -/******************************************************************************* - * API function definition - ******************************************************************************/ - -#if defined(USE_DLL) && defined(_WIN32) -#define DLL_SHARED __declspec(dllimport) -#elif defined (_WINDLL) -#define DLL_SHARED __declspec(dllexport) -#else -#define DLL_SHARED -#endif - -#if defined(__cplusplus) -extern "C" { -#endif /* __cplusplus */ -DLL_SHARED xa_codec_func_t xa_pcm_codec; -#if defined(__cplusplus) -} -#endif /* __cplusplus */ - -#endif /* __XA_PCM_API_H__ */ - diff --git a/hifi/xaf/host-apf/include/audio/xa_apicmd_standards.h b/hifi/xaf/host-apf/include/audio/xa_apicmd_standards.h deleted file mode 100644 index eb1b78e1..00000000 --- a/hifi/xaf/host-apf/include/audio/xa_apicmd_standards.h +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_API_CMD_STANDARDS_H__ -#define __XA_API_CMD_STANDARDS_H__ - -/*****************************************************************************/ -/* Standard API commands */ -/*****************************************************************************/ - -enum xa_api_cmd_generic { - XA_API_CMD_GET_LIB_ID_STRINGS = 0x0001, - - XA_API_CMD_GET_API_SIZE = 0x0002, - XA_API_CMD_INIT = 0x0003, - - XA_API_CMD_SET_CONFIG_PARAM = 0x0004, - XA_API_CMD_GET_CONFIG_PARAM = 0x0005, - - XA_API_CMD_GET_MEMTABS_SIZE = 0x0006, - XA_API_CMD_SET_MEMTABS_PTR = 0x0007, - XA_API_CMD_GET_N_MEMTABS = 0x0008, - - XA_API_CMD_EXECUTE = 0x0009, - - XA_API_CMD_PUT_INPUT_QUERY = 0x000A, - XA_API_CMD_GET_CURIDX_INPUT_BUF = 0x000B, - XA_API_CMD_SET_INPUT_BYTES = 0x000C, - XA_API_CMD_GET_OUTPUT_BYTES = 0x000D, - XA_API_CMD_INPUT_OVER = 0x000E, - - XA_API_CMD_GET_MEM_INFO_SIZE = 0x0010, - XA_API_CMD_GET_MEM_INFO_ALIGNMENT = 0x0011, - XA_API_CMD_GET_MEM_INFO_TYPE = 0x0012, - XA_API_CMD_GET_MEM_INFO_PLACEMENT = 0x0013, - XA_API_CMD_GET_MEM_INFO_PRIORITY = 0x0014, - XA_API_CMD_SET_MEM_PTR = 0x0015, - XA_API_CMD_SET_MEM_INFO_SIZE = 0x0016, - XA_API_CMD_SET_MEM_PLACEMENT = 0x0017, - - XA_API_CMD_GET_N_TABLES = 0x0018, - XA_API_CMD_GET_TABLE_INFO_SIZE = 0x0019, - XA_API_CMD_GET_TABLE_INFO_ALIGNMENT = 0x001A, - XA_API_CMD_GET_TABLE_INFO_PRIORITY = 0x001B, - XA_API_CMD_SET_TABLE_PTR = 0x001C, - XA_API_CMD_GET_TABLE_PTR = 0x001D -}; - -/*****************************************************************************/ -/* Standard API command indices */ -/*****************************************************************************/ - -enum xa_cmd_type_generic { - /* XA_API_CMD_GET_LIB_ID_STRINGS indices */ - XA_CMD_TYPE_LIB_NAME = 0x0100, - XA_CMD_TYPE_LIB_VERSION = 0x0200, - XA_CMD_TYPE_API_VERSION = 0x0300, - - /* XA_API_CMD_INIT indices */ - XA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS = 0x0100, - XA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS = 0x0200, - XA_CMD_TYPE_INIT_PROCESS = 0x0300, - XA_CMD_TYPE_INIT_DONE_QUERY = 0x0400, - - /* XA_API_CMD_EXECUTE indices */ - XA_CMD_TYPE_DO_EXECUTE = 0x0100, - XA_CMD_TYPE_DONE_QUERY = 0x0200, - XA_CMD_TYPE_DO_RUNTIME_INIT = 0x0300 -}; - - -/*****************************************************************************/ -/* Standard API configuration parameters */ -/*****************************************************************************/ - -enum xa_config_param_generic { - XA_CONFIG_PARAM_CUR_INPUT_STREAM_POS = 0x0100, - XA_CONFIG_PARAM_GEN_INPUT_STREAM_POS = 0x0200, -}; - -#endif /* __XA_API_CMD_STANDARDS_H__ */ diff --git a/hifi/xaf/host-apf/include/audio/xa_error_standards.h b/hifi/xaf/host-apf/include/audio/xa_error_standards.h deleted file mode 100644 index 1b67b52f..00000000 --- a/hifi/xaf/host-apf/include/audio/xa_error_standards.h +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_ERROR_STANDARDS_H__ -#define __XA_ERROR_STANDARDS_H__ - -/*****************************************************************************/ -/* File includes */ -/* xa_type_def.h */ -/*****************************************************************************/ - -/*****************************************************************************/ -/* Constant hash defines */ -/*****************************************************************************/ -#define XA_NO_ERROR 0 -#define XA_FATAL_ERROR 0x80000000 - -enum xa_error_severity { - xa_severity_nonfatal = 0, - xa_severity_fatal = 0xffffffff -}; - -enum xa_error_class { - xa_class_api = 0, - xa_class_config = 1, - xa_class_execute = 2, - xa_class_proxy = 3 -}; - -#define XA_CODEC_GENERIC 0 - -#define XA_ERROR_CODE(severity, class, codec, index) ((severity << 15) | (class << 11) | (codec << 6) | index) -#define XA_ERROR_SEVERITY(code) (((code) & XA_FATAL_ERROR) != 0) -#define XA_ERROR_CLASS(code) (((code) >> 11) & 0x0f) -#define XA_ERROR_CODEC(code) (((code) >> 6) & 0x1f) -#define XA_ERROR_SUBCODE(code) (((code) >> 0) & 0x3f) - -/* Our convention is that only api-class errors can be generic ones. */ - -/*****************************************************************************/ -/* Class 0: API Errors */ -/*****************************************************************************/ -/* Non Fatal Errors */ -/* (none) */ -/* Fatal Errors */ -enum xa_error_fatal_api_generic { - XA_API_FATAL_MEM_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 0), - XA_API_FATAL_MEM_ALIGN = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 1), - XA_API_FATAL_INVALID_CMD = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 2), - XA_API_FATAL_INVALID_CMD_TYPE = XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_GENERIC, 3) -}; - -#endif /* __XA_ERROR_STANDARDS_H__ */ diff --git a/hifi/xaf/host-apf/include/audio/xa_memory_standards.h b/hifi/xaf/host-apf/include/audio/xa_memory_standards.h deleted file mode 100644 index 27ec455f..00000000 --- a/hifi/xaf/host-apf/include/audio/xa_memory_standards.h +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_MEMORY_STANDARDS_H__ -#define __XA_MEMORY_STANDARDS_H__ - -/*****************************************************************************/ -/* Constant hash defines */ -/*****************************************************************************/ -/* when you don't need alignment, pass this to memory library */ -#define XA_MEM_NO_ALIGN 0x01 - -/* standard memory types */ -/* to be used inter frames */ -#define XA_MEMTYPE_PERSIST 0x00 -/* read write, to be used intra frames */ -#define XA_MEMTYPE_SCRATCH 0x01 -/* read only memory, intra frame */ -#define XA_MEMTYPE_INPUT 0x02 -/* read-write memory, for usable output, intra frame */ -#define XA_MEMTYPE_OUTPUT 0x03 -/* readonly memory, inter frame */ -#define XA_MEMTYPE_TABLE 0x04 -/* input buffer before mem tabs allocation */ -#define XA_MEMTYPE_PRE_FRAME_INPUT 0x05 -/* input buffer before mem tabs allocation */ -#define XA_MEMTYPE_PRE_FRAME_SCRATCH 0x06 -/* for local variables */ -#define XA_MEMTYPE_AUTO_VAR 0x80 - -/* standard memory priorities */ -#define XA_MEMPRIORITY_ANYWHERE 0x00 -#define XA_MEMPRIORITY_LOWEST 0x01 -#define XA_MEMPRIORITY_LOW 0x02 -#define XA_MEMPRIORITY_NORM 0x03 -#define XA_MEMPRIORITY_ABOVE_NORM 0x04 -#define XA_MEMPRIORITY_HIGH 0x05 -#define XA_MEMPRIORITY_HIGHER 0x06 -#define XA_MEMPRIORITY_CRITICAL 0x07 - -/* standard memory placements */ -/* placement is defined by 64 bits */ - -#define XA_MEMPLACE_FAST_RAM_0 0x000001 -#define XA_MEMPLACE_FAST_RAM_1 0x000002 -#define XA_MEMPLACE_FAST_RAM_2 0x000004 -#define XA_MEMPLACE_FAST_RAM_3 0x000008 -#define XA_MEMPLACE_FAST_RAM_4 0x000010 -#define XA_MEMPLACE_FAST_RAM_5 0x000020 -#define XA_MEMPLACE_FAST_RAM_6 0x000040 -#define XA_MEMPLACE_FAST_RAM_7 0x000080 - -#define XA_MEMPLACE_INT_RAM_0 0x000100 -#define XA_MEMPLACE_INT_RAM_1 0x000200 -#define XA_MEMPLACE_INT_RAM_2 0x000400 -#define XA_MEMPLACE_INT_RAM_3 0x000800 -#define XA_MEMPLACE_INT_RAM_4 0x001000 -#define XA_MEMPLACE_INT_RAM_5 0x002000 -#define XA_MEMPLACE_INT_RAM_6 0x004000 -#define XA_MEMPLACE_INT_RAM_7 0x008000 - -#define XA_MEMPLACE_EXT_RAM_0 0x010000 -#define XA_MEMPLACE_EXT_RAM_1 0x020000 -#define XA_MEMPLACE_EXT_RAM_2 0x040000 -#define XA_MEMPLACE_EXT_RAM_3 0x080000 -#define XA_MEMPLACE_EXT_RAM_4 0x100000 -#define XA_MEMPLACE_EXT_RAM_5 0x200000 -#define XA_MEMPLACE_EXT_RAM_6 0x400000 -#define XA_MEMPLACE_EXT_RAM_7 0x800000 - -#define XA_MEMPLACE_DONTCARE_H 0xFFFFFFFF -#define XA_MEMPLACE_DONTCARE_L 0xFFFFFFFF - -/* the simple common PC RAM */ -#define XA_PC_RAM_H 0x00000000 -#define XA_PC_RAM_L XA_MEMPLACE_EXT_RAM_0 - -#endif /* __XA_MEMORY_STANDARDS_H__ */ diff --git a/hifi/xaf/host-apf/include/audio/xa_type_def.h b/hifi/xaf/host-apf/include/audio/xa_type_def.h deleted file mode 100644 index e83cdd34..00000000 --- a/hifi/xaf/host-apf/include/audio/xa_type_def.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - -#ifndef __XA_TYPE_DEF_H__ -#define __XA_TYPE_DEF_H__ - -/****************************************************************************/ -/* types type define prefix examples bytes */ -/************************ *********** ****** **************** ***** */ -typedef signed char WORD8 ;/* b WORD8 b_name 1 */ -typedef signed char * pWORD8 ;/* pb pWORD8 pb_nmae 1 */ -typedef unsigned char UWORD8 ;/* ub UWORD8 ub_count 1 */ -typedef unsigned char * pUWORD8 ;/* pub pUWORD8 pub_count 1 */ - -typedef signed short WORD16 ;/* s WORD16 s_count 2 */ -typedef signed short * pWORD16 ;/* ps pWORD16 ps_count 2 */ -typedef unsigned short UWORD16 ;/* us UWORD16 us_count 2 */ -typedef unsigned short * pUWORD16;/* pus pUWORD16 pus_count 2 */ - -typedef signed int WORD24 ;/* k WORD24 k_count 3 */ -typedef signed int * pWORD24 ;/* pk pWORD24 pk_count 3 */ -typedef unsigned int UWORD24 ;/* uk UWORD24 uk_count 3 */ -typedef unsigned int * pUWORD24;/* puk pUWORD24 puk_count 3 */ - -typedef signed int WORD32 ;/* i WORD32 i_count 4 */ -typedef signed int * pWORD32 ;/* pi pWORD32 pi_count 4 */ -typedef unsigned int UWORD32 ;/* ui UWORD32 ui_count 4 */ -typedef unsigned int * pUWORD32;/* pui pUWORD32 pui_count 4 */ - -typedef signed long long WORD40 ;/* m WORD40 m_count 5 */ -typedef signed long long * pWORD40 ;/* pm pWORD40 pm_count 5 */ -typedef unsigned long long UWORD40 ;/* um UWORD40 um_count 5 */ -typedef unsigned long long * pUWORD40;/* pum pUWORD40 pum_count 5 */ - -typedef signed long long WORD64 ;/* h WORD64 h_count 8 */ -typedef signed long long * pWORD64 ;/* ph pWORD64 ph_count 8 */ -typedef unsigned long long UWORD64 ;/* uh UWORD64 uh_count 8 */ -typedef unsigned long long * pUWORD64;/* puh pUWORD64 puh_count 8 */ - -typedef float FLOAT32 ;/* f FLOAT32 f_count 4 */ -typedef float * pFLOAT32;/* pf pFLOAT32 pf_count 4 */ -typedef double FLOAT64 ;/* d UFLOAT64 d_count 8 */ -typedef double * pFlOAT64;/* pd pFLOAT64 pd_count 8 */ - -typedef void VOID ;/* v VOID v_flag 4 */ -typedef void * pVOID ;/* pv pVOID pv_flag 4 */ - -/* variable size types: platform optimized implementation */ -//typedef signed int BOOL ;/* bool BOOL bool_true */ -//typedef unsigned int UBOOL ;/* ubool BOOL ubool_true */ -typedef signed int FLAG ;/* flag FLAG flag_false */ -typedef unsigned int UFLAG ;/* uflag FLAG uflag_false */ -typedef signed int LOOPIDX ;/* lp LOOPIDX lp_index */ -typedef unsigned int ULOOPIDX;/* ulp SLOOPIDX ulp_index */ -typedef signed int WORD ;/* lp LOOPIDX lp_index */ -typedef unsigned int UWORD ;/* ulp SLOOPIDX ulp_index */ - -typedef LOOPIDX LOOPINDEX; /* lp LOOPIDX lp_index */ -typedef ULOOPIDX ULOOPINDEX;/* ulp SLOOPIDX ulp_index */ - -#define PLATFORM_INLINE __inline - -typedef struct xa_codec_opaque { WORD32 _; } *xa_codec_handle_t; - -typedef int XA_ERRORCODE; - -typedef XA_ERRORCODE xa_codec_func_t(xa_codec_handle_t p_xa_module_obj, - WORD32 i_cmd, - WORD32 i_idx, - pVOID pv_value); - -#endif /* __XA_TYPE_DEF_H__ */ diff --git a/hifi/xaf/host-apf/include/audio/xa_vorbis_dec_api.h b/hifi/xaf/host-apf/include/audio/xa_vorbis_dec_api.h deleted file mode 100644 index f99660f8..00000000 --- a/hifi/xaf/host-apf/include/audio/xa_vorbis_dec_api.h +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -/******************************************************************************* -* -* NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC -* LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. -* -******************************************************************************/ - - - -#ifndef __XA_VORBIS_DEC_API_H__ -#define __XA_VORBIS_DEC_API_H__ - -#include <xa_memory_standards.h> - -/* vorbis_dec-specific configuration parameters */ -enum xa_config_param_vorbis_dec -{ - XA_VORBISDEC_CONFIG_PARAM_SAMP_FREQ = 0, - XA_VORBISDEC_CONFIG_PARAM_NUM_CHANNELS = 1, - XA_VORBISDEC_CONFIG_PARAM_PCM_WDSZ = 2, - XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_PTR = 3, - XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_SIZE = 4, - XA_VORBISDEC_CONFIG_PARAM_GET_CUR_BITRATE = 5, - XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_FILE_MODE = 6, - XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_LAST_PKT_GRANULE_POS = 7, - XA_VORBISDEC_CONFIG_PARAM_OGG_MAX_PAGE_SIZE = 8, - XA_VORBISDEC_CONFIG_PARAM_RUNTIME_MEM = 9 -}; - -/* commands */ -#include <xa_apicmd_standards.h> - -/* vorbis_dec-specific command types */ -/* (none) */ - -/* error codes */ -#include <xa_error_standards.h> -#define XA_CODEC_VORBIS_DEC 7 - -/* vorbis_dec-specific error codes */ - -/*****************************************************************************/ -/* Class 1: Configuration Errors */ -/*****************************************************************************/ -/* Nonfatal Errors */ -enum xa_error_nonfatal_config_vorbis_dec -{ - XA_VORBISDEC_CONFIG_NONFATAL_GROUPED_STREAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_CONFIG_NONFATAL_BAD_PARAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1) -}; - -/* Fatal Errors */ -enum xa_error_fatal_config_vorbis_dec -{ - XA_VORBISDEC_CONFIG_FATAL_BADHDR = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_CONFIG_FATAL_NOTVORBIS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_CONFIG_FATAL_BADINFO = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_CONFIG_FATAL_BADVERSION = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 3), - XA_VORBISDEC_CONFIG_FATAL_BADBOOKS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 4), - XA_VORBISDEC_CONFIG_FATAL_CODEBOOK_DECODE = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 5), - XA_VORBISDEC_CONFIG_FATAL_INVALID_PARAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 6) -}; - -/*****************************************************************************/ -/* Class 2: Execution Errors */ -/*****************************************************************************/ -/* Nonfatal Errors */ -enum xa_error_nonfatal_execute_vorbis_dec -{ - XA_VORBISDEC_EXECUTE_NONFATAL_OV_HOLE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_NOTAUDIO = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_BADPACKET = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_RUNTIME_DECODE_FLUSH_IN_PROGRESS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_INVALID_STRM_POS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 4), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_INSUFFICIENT_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 5), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_IDENT_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 6), - XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_HEADER_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 7) -}; -/* Fatal Errors */ -enum xa_error_fatal_execute_vorbis_dec -{ - XA_VORBISDEC_EXECUTE_FATAL_PERSIST_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), - XA_VORBISDEC_EXECUTE_FATAL_SCRATCH_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), - XA_VORBISDEC_EXECUTE_FATAL_CORRUPT_STREAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), - XA_VORBISDEC_EXECUTE_FATAL_INSUFFICIENT_INP_BUF_SIZE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3) -}; - -#include "xa_type_def.h" - -#ifdef __cplusplus - extern "C" { -#endif /* __cplusplus */ - - xa_codec_func_t xa_vorbis_dec; - -#ifdef __cplusplus - } -#endif /* __cplusplus */ - -#endif /* __XA_VORBIS_DEC_API_H__ */ diff --git a/hifi/xaf/host-apf/include/os/android/xf-osal.h b/hifi/xaf/host-apf/include/os/android/xf-osal.h deleted file mode 100644 index 6286405e..00000000 --- a/hifi/xaf/host-apf/include/os/android/xf-osal.h +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-osal.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include <pthread.h> -#include <fcntl.h> -#include <limits.h> -#include <sys/mman.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <log/log.h> - -/******************************************************************************* - * Tracing primitive - ******************************************************************************/ - -#define __xf_puts(str) \ - ALOG(LOG_INFO, "PROXY", "%s", (str)) - -/******************************************************************************* - * Lock operation - ******************************************************************************/ - -/* ...lock definition */ -typedef pthread_mutex_t xf_lock_t; - -/* ...lock initialization */ -static inline void __xf_lock_init(xf_lock_t *lock) -{ - pthread_mutex_init(lock, NULL); -} - -/* ...lock acquisition */ -static inline void __xf_lock(xf_lock_t *lock) -{ - pthread_mutex_lock(lock); -} - -/* ...lock release */ -static inline void __xf_unlock(xf_lock_t *lock) -{ - pthread_mutex_unlock(lock); -} - -/******************************************************************************* - * Waiting object - ******************************************************************************/ - -/* ...waiting object handle */ -typedef struct __xf_wait -{ - /* ...conditional variable */ - pthread_cond_t wait; - - /* ...waiting mutex */ - pthread_mutex_t mutex; - -} xf_wait_t; - -/* ...initialize waiting object */ -static inline void __xf_wait_init(xf_wait_t *w) -{ - pthread_cond_init(&w->wait, NULL); - pthread_mutex_init(&w->mutex, NULL); -} - -/* ...prepare to waiting */ -static inline void __xf_wait_prepare(xf_wait_t *w) -{ - pthread_mutex_lock(&w->mutex); -} - -#define __xf_wait_prepare(w) \ -({ \ - TRACE(1, _x("prepare-wait")); \ - (__xf_wait_prepare)(w); \ -}) - -/* ...wait until event is signalled */ -static inline int __xf_wait(xf_wait_t *w, u32 timeout) -{ - struct timespec ts; - struct timeval tv; - int r; - - /* ...wait with or without timeout (communication mutex is taken) */ - if (!timeout) - { - r = -pthread_cond_wait(&w->wait, &w->mutex); - } - else - { - /* ...get current time */ - gettimeofday(&tv, NULL); - - /* ...set absolute timeout */ - ts.tv_sec = tv.tv_sec + timeout / 1000; - ts.tv_nsec = tv.tv_usec * 1000 + (timeout % 1000) * 1000000; - (ts.tv_nsec >= 1000000000 ? ts.tv_sec++, ts.tv_nsec -= 1000000000 : 0); - - /* ...wait conditionally with absolute timeout*/ - r = -pthread_cond_timedwait(&w->wait, &w->mutex, &ts); - } - - /* ...leave with communication mutex taken */ - return r; -} - -#define __xf_wait(w, timeout) \ -({ \ - int __r; \ - TRACE(1, _x("wait")); \ - __r = (__xf_wait)(w, timeout); \ - TRACE(1, _x("resume")); \ - __r; \ -}) - -/* ...wake up waiting handle */ -static inline void __xf_wakeup(xf_wait_t *w) -{ - /* ...take communication mutex before signaling */ - pthread_mutex_lock(&w->mutex); - - /* ...signalling will resume waiting thread */ - pthread_cond_signal(&w->wait); - - /* ...assure that waiting task will not resume until we say this - is that really needed? - tbd */ - pthread_mutex_unlock(&w->mutex); -} - -#define __xf_wakeup(w) \ -({ \ - TRACE(1, _x("wakeup")); \ - (__xf_wakeup)(w); \ -}) - -/* ...complete waiting operation */ -static inline void __xf_wait_complete(xf_wait_t *w) -{ - pthread_mutex_unlock(&w->mutex); -} - -#define __xf_wait_complete(w) \ -({ \ - TRACE(1, _x("wait-complete")); \ - (__xf_wait_complete)(w); \ -}) - -/******************************************************************************* - * Thread support - ******************************************************************************/ - -/* ...thread handle definition */ -typedef pthread_t xf_thread_t; - -/* ...thread creation */ -static inline int __xf_thread_create(xf_thread_t *thread, void * (*f)(void *), void *arg) -{ - pthread_attr_t attr; - int r; - - /* ...initialize thread attributes - joinable with minimal stack */ - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); - - /* ...create proxy asynchronous thread managing SHMEM */ - r = -pthread_create(thread, &attr, f, arg); - - /* ...destroy thread attributes */ - pthread_attr_destroy(&attr); - - return r; -} - -/* ...terminate thread operation */ -static inline int __xf_thread_destroy(xf_thread_t *thread) -{ - void *r; - - /* ...tell the thread to terminate */ - pthread_kill(*thread,SIGUSR1); - - /* ...wait until thread terminates */ - pthread_join(*thread, &r); - - /* ...return final status */ - return (int)(intptr_t)r; -} diff --git a/hifi/xaf/host-apf/include/os/xos/xf-osal.h b/hifi/xaf/host-apf/include/os/xos/xf-osal.h deleted file mode 100644 index c3468000..00000000 --- a/hifi/xaf/host-apf/include/os/xos/xf-osal.h +++ /dev/null @@ -1,206 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-osal.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ -#include "xos.h" - -/******************************************************************************* - * Tracing primitive - ******************************************************************************/ - -#define __xf_puts(str) \ - puts((str)) - -/******************************************************************************* - * Lock operation - ******************************************************************************/ - -/* ...lock definition */ -typedef XosMutex xf_lock_t; - -/* ...lock initialization */ -static inline void __xf_lock_init(xf_lock_t *lock) -{ - xos_mutex_create(lock, XOS_MUTEX_WAIT_PRIORITY, 0); -} - -/* ...lock acquisition */ -static inline void __xf_lock(xf_lock_t *lock) -{ - xos_mutex_lock(lock); -} - -/* ...lock release */ -static inline void __xf_unlock(xf_lock_t *lock) -{ - xos_mutex_unlock(lock); -} - -/******************************************************************************* - * Waiting object - ******************************************************************************/ - -#if 0 -/* ...waiting object handle */ -typedef struct __xf_wait -{ - /* ...conditional variable */ - pthread_cond_t wait; - - /* ...waiting mutex */ - pthread_mutex_t mutex; - -} xf_wait_t; - -/* ...initialize waiting object */ -static inline void __xf_wait_init(xf_wait_t *w) -{ - pthread_cond_init(&w->wait, NULL); - pthread_mutex_init(&w->mutex, NULL); -} - -/* ...prepare to waiting */ -static inline void __xf_wait_prepare(xf_wait_t *w) -{ - pthread_mutex_lock(&w->mutex); -} - -#define __xf_wait_prepare(w) \ -({ \ - TRACE(1, _x("prepare-wait")); \ - (__xf_wait_prepare)(w); \ -}) - -/* ...wait until event is signalled */ -static inline int __xf_wait(xf_wait_t *w, u32 timeout) -{ - struct timespec ts; - struct timeval tv; - int r; - - /* ...wait with or without timeout (communication mutex is taken) */ - if (!timeout) - { - r = -pthread_cond_wait(&w->wait, &w->mutex); - } - else - { - /* ...get current time */ - gettimeofday(&tv, NULL); - - /* ...set absolute timeout */ - ts.tv_sec = tv.tv_sec + timeout / 1000; - ts.tv_nsec = tv.tv_usec * 1000 + (timeout % 1000) * 1000000; - (ts.tv_nsec >= 1000000000 ? ts.tv_sec++, ts.tv_nsec -= 1000000000 : 0); - - /* ...wait conditionally with absolute timeout*/ - r = -pthread_cond_timedwait(&w->wait, &w->mutex, &ts); - } - - /* ...leave with communication mutex taken */ - return r; -} - -#define __xf_wait(w, timeout) \ -({ \ - int __r; \ - TRACE(1, _x("wait")); \ - __r = (__xf_wait)(w, timeout); \ - TRACE(1, _x("resume")); \ - __r; \ -}) - -/* ...wake up waiting handle */ -static inline void __xf_wakeup(xf_wait_t *w) -{ - /* ...take communication mutex before signaling */ - pthread_mutex_lock(&w->mutex); - - /* ...signalling will resume waiting thread */ - pthread_cond_signal(&w->wait); - - /* ...assure that waiting task will not resume until we say this - is that really needed? - tbd */ - pthread_mutex_unlock(&w->mutex); -} - -#define __xf_wakeup(w) \ -({ \ - TRACE(1, _x("wakeup")); \ - (__xf_wakeup)(w); \ -}) - -/* ...complete waiting operation */ -static inline void __xf_wait_complete(xf_wait_t *w) -{ - pthread_mutex_unlock(&w->mutex); -} - -#define __xf_wait_complete(w) \ -({ \ - TRACE(1, _x("wait-complete")); \ - (__xf_wait_complete)(w); \ -}) -#endif - -/******************************************************************************* - * Thread support - ******************************************************************************/ - -/* ...thread handle definition */ -typedef XosThread xf_thread_t; -typedef XosThreadFunc xf_entry_t; - -/* ...thread creation */ -static inline int __xf_thread_create(xf_thread_t *thread, xf_entry_t *f, - void *arg, const char *name, void * stack, - unsigned int stack_size, int priority) -{ - int r; - - /* ...create proxy asynchronous thread managing SHMEM */ - r = xos_thread_create(thread, 0, f, arg, name, stack, stack_size, priority, 0, 0); - - return r; -} - -/* ...terminate thread operation */ -static inline int __xf_thread_destroy(xf_thread_t *thread) -{ - int r; - - /* ...wait until thread terminates */ - /* v-tbd - avoid infinite wait for join */ - //xos_thread_join(thread, &r); - - /* ...delete thread, free up TCB, stack */ - r = xos_thread_delete(thread); - - /* ...return final status */ - return r; -} - diff --git a/hifi/xaf/host-apf/include/sys/fio/xf-config.h b/hifi/xaf/host-apf/include/sys/fio/xf-config.h deleted file mode 100644 index 2e1d4c61..00000000 --- a/hifi/xaf/host-apf/include/sys/fio/xf-config.h +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/* ...number of DSP cores */ -#define XF_CFG_CORES_NUM 4 - -/* ...maximal number of clients supported by proxy */ -#define XF_CFG_PROXY_MAX_CLIENTS 256 - -/* ...size of the shared memory pool (in bytes) */ -#define XF_CFG_REMOTE_IPC_POOL_SIZE (256 << 10) - -/* ...size of the component(DSP) local memory pool (in bytes) */ -#define XF_CFG_LOCAL_POOL_SIZE (1024<< 10) - -/* ...alignment for shared buffers */ -#define XF_PROXY_ALIGNMENT 64 diff --git a/hifi/xaf/host-apf/include/sys/fio/xf-hal.h b/hifi/xaf/host-apf/include/sys/fio/xf-hal.h deleted file mode 100644 index 15a82b03..00000000 --- a/hifi/xaf/host-apf/include/sys/fio/xf-hal.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-hal.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...primitive types */ -#include "xf-types.h" - -/* ...anything else? - tbd */ diff --git a/hifi/xaf/host-apf/include/sys/fio/xf-ipc.h b/hifi/xaf/host-apf/include/sys/fio/xf-ipc.h deleted file mode 100644 index 2ee859a8..00000000 --- a/hifi/xaf/host-apf/include/sys/fio/xf-ipc.h +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-ipc.h mustn't be included directly" -#endif - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...proxy IPC data */ -typedef struct xf_proxy_ipc_data -{ - /* ...shared memory buffer pointer */ - void *shmem; - - /* ...file descriptor */ - int fd; - - /* ...pipe for asynchronous response delivery */ - int pipe[2]; - -} xf_proxy_ipc_data_t; - -/******************************************************************************* - * Helpers for asynchronous response delivery - ******************************************************************************/ - -#define xf_proxy_ipc_response_put(ipc, msg) \ - (write((ipc)->pipe[1], (msg), sizeof(*(msg))) == sizeof(*(msg)) ? 0 : -errno) - -#define xf_proxy_ipc_response_get(ipc, msg) \ - (read((ipc)->pipe[0], (msg), sizeof(*(msg))) == sizeof(*(msg)) ? 0 : -errno) - -/******************************************************************************* - * Shared memory translation - ******************************************************************************/ - -/* ...translate proxy shared address into local virtual address */ -static inline void * xf_ipc_a2b(xf_proxy_ipc_data_t *ipc, u32 address) -{ - if (address < XF_CFG_REMOTE_IPC_POOL_SIZE) - return (unsigned char *) ipc->shmem + address; - else if (address == XF_PROXY_NULL) - return NULL; - else - return (void *) -1; -} - -/* ...translate local virtual address into shared proxy address */ -static inline u32 xf_ipc_b2a(xf_proxy_ipc_data_t *ipc, void *b) -{ - u32 a; - - if (b == NULL) - return XF_PROXY_NULL; - if ((a = (u32)((u8 *)b - (u8 *)ipc->shmem)) < XF_CFG_REMOTE_IPC_POOL_SIZE) - return a; - else - return XF_PROXY_BADADDR; -} - -/******************************************************************************* - * Component inter-process communication - ******************************************************************************/ - -typedef struct xf_ipc_data -{ - /* ...asynchronous response delivery pipe */ - int pipe[2]; - -} xf_ipc_data_t; - -/******************************************************************************* - * Helpers for asynchronous response delivery - ******************************************************************************/ - -#define xf_ipc_response_put(ipc, msg) \ - (write((ipc)->pipe[1], (msg), sizeof(*(msg))) == sizeof(*(msg)) ? 0 : -errno) - -#define xf_ipc_response_get(ipc, msg) \ - (read((ipc)->pipe[0], (msg), sizeof(*(msg))) == sizeof(*(msg)) ? 0 : -errno) - -#define xf_ipc_data_init(ipc) \ - (pipe((ipc)->pipe) == 0 ? 0 : -errno) - -#define xf_ipc_data_destroy(ipc) \ - (close((ipc)->pipe[0]), close((ipc)->pipe[1])) - -/******************************************************************************* -* API functions - ******************************************************************************/ - -/* ...send asynchronous command */ -extern int xf_ipc_send(xf_proxy_ipc_data_t *ipc, xf_proxy_msg_t *msg, void *b); - -/* ...wait for response from remote proxy */ -extern int xf_ipc_wait(xf_proxy_ipc_data_t *ipc, u32 timeout); - -/* ...receive response from IPC layer */ -extern int xf_ipc_recv(xf_proxy_ipc_data_t *ipc, xf_proxy_msg_t *msg, void **b); - -/* ...open proxy interface on proper DSP partition */ -extern int xf_ipc_open(xf_proxy_ipc_data_t *proxy, u32 core, void *p_shmem); - -/* ...close proxy handle */ -extern void xf_ipc_close(xf_proxy_ipc_data_t *proxy, u32 core); diff --git a/hifi/xaf/host-apf/include/sys/fio/xf-runtime.h b/hifi/xaf/host-apf/include/sys/fio/xf-runtime.h deleted file mode 100644 index 9cad95f4..00000000 --- a/hifi/xaf/host-apf/include/sys/fio/xf-runtime.h +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-runtime.h mustn't be included directly" -#endif - -/******************************************************************************* - * Includes - ******************************************************************************/ - -/* ...platform HAL layer */ -#include "xf-hal.h" - -/* ...OS abstraction layer */ -#include "xf-osal.h" diff --git a/hifi/xaf/host-apf/include/sys/fio/xf-types.h b/hifi/xaf/host-apf/include/sys/fio/xf-types.h deleted file mode 100644 index a610c8e1..00000000 --- a/hifi/xaf/host-apf/include/sys/fio/xf-types.h +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-types.h mustn't be included directly" -#endif - -/******************************************************************************* - * Standard includes - ******************************************************************************/ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include <stdarg.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <assert.h> -#include <errno.h> - -#include <unistd.h> -#include <fcntl.h> -#include <pthread.h> -#include <signal.h> -#include <limits.h> -#include <sys/mman.h> -#include <sys/ioctl.h> -#include <sys/time.h> - -/******************************************************************************* - * Primitive types - ******************************************************************************/ - -typedef uint32_t u32; -typedef int32_t s32; -typedef uint16_t u16; -typedef int16_t s16; -typedef uint8_t u8; -typedef int8_t s8; - -/******************************************************************************* - * Macros definitions - ******************************************************************************/ - -/* ...NULL-address specification */ -#define XF_PROXY_NULL (~0U) - -/* ...invalid proxy address */ -#define XF_PROXY_BADADDR XF_CFG_REMOTE_IPC_POOL_SIZE - -/******************************************************************************* - * Auxiliary helpers - ******************************************************************************/ - -/* ...next power-of-two calculation */ -#define xf_next_power_of_two(v) __xf_power_of_two_1((v) - 1) -#define __xf_power_of_two_1(v) __xf_power_of_two_2((v) | ((v) >> 1)) -#define __xf_power_of_two_2(v) __xf_power_of_two_3((v) | ((v) >> 2)) -#define __xf_power_of_two_3(v) __xf_power_of_two_4((v) | ((v) >> 4)) -#define __xf_power_of_two_4(v) __xf_power_of_two_5((v) | ((v) >> 8)) -#define __xf_power_of_two_5(v) __xf_power_of_two_6((v) | ((v) >> 16)) -#define __xf_power_of_two_6(v) ((v) + 1) - -/* ...check if non-zero value is a power-of-two */ -#define xf_is_power_of_two(v) (((v) & ((v) - 1)) == 0) - diff --git a/hifi/xaf/host-apf/include/xaf-api.h b/hifi/xaf/host-apf/include/xaf-api.h deleted file mode 100644 index 5cebb430..00000000 --- a/hifi/xaf/host-apf/include/xaf-api.h +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - - -/* ...number of max input buffers */ -#define XAF_MAX_INBUFS 2 -#define XAF_INBUF_SIZE 8192 - -typedef enum { - XAF_DECODER = 0, - XAF_ENCODER = 1, - XAF_MIXER = 2, - XAF_PRE_PROC = 3, - XAF_POST_PROC = 4, -} xaf_comp_type; - -typedef enum { - XAF_STARTING = 0, - XAF_INIT_DONE = 1, - XAF_NEED_INPUT = 2, - XAF_OUTPUT_READY = 3, - XAF_EXEC_DONE = 4, -} xaf_comp_status; - -typedef enum { - XAF_START_FLAG = 1, - XAF_EXEC_FLAG = 2, - XAF_INPUT_OVER_FLAG = 3, - XAF_INPUT_READY_FLAG = 4, - XAF_NEED_OUTPUT_FLAG = 5, -} xaf_comp_flag; - -typedef enum { - XAF_NO_ERROR = 0, - XAF_PTR_ERROR = -1, - XAF_INVALID_VALUE = -2, - XAF_ROUTING_ERROR = -3, - /*XAF_XOS_ERROR = -4,*/ - XAF_API_ERR = -5, -} XAF_ERR_CODE; - -typedef enum { - XAF_MEM_ID_DEV = 0, - XAF_MEM_ID_COMP = 1, -} XAF_MEM_ID; - -/* structure for component memory sizes */ -typedef struct xaf_mem_size_s{ - u32 persist; - u32 scratch; - u32 input; - u32 output; -}xaf_mem_size_t; - -/* structure for host-side utility handles */ -typedef struct xaf_ap_utils_s{ - int xf_cfg_remote_ipc_pool_size; - xaf_mem_size_t mem_size; -}xaf_ap_utils_t; - -typedef struct xaf_format_s { - u32 sample_rate; - u32 channels; - u32 pcm_width; - u32 input_length; - u32 output_length; -} xaf_format_t; - -#ifndef XAF_HOSTLESS -typedef struct xaf_info_s { - void * buf; - u32 length; -} xaf_info_t; -#endif - -XAF_ERR_CODE xaf_adev_open(void **pp_adev, s32 audio_frmwk_buf_size, s32 audio_comp_buf_size, xaf_mem_malloc_fxn_t mm_malloc, xaf_mem_free_fxn_t mm_free); -XAF_ERR_CODE xaf_adev_close(void *adev_ptr, xaf_comp_flag flag); - -XAF_ERR_CODE xaf_comp_create(void* p_adev, void **p_comp, xf_id_t comp_id, u32 ninbuf, u32 noutbuf, void *pp_inbuf[], xaf_comp_type comp_type); -XAF_ERR_CODE xaf_comp_delete(void* p_comp); -XAF_ERR_CODE xaf_comp_set_config(void *p_comp, s32 num_param, s32 *p_param); -XAF_ERR_CODE xaf_comp_get_config(void *p_comp, s32 num_param, s32 *p_param); -XAF_ERR_CODE xaf_comp_process(void *p_adev, void *p_comp, void *p_buf, u32 length, xaf_comp_flag flag); -XAF_ERR_CODE xaf_connect(void *p_src, void *p_dest, s32 num_buf); - -/* Not available in this version yet. -XAF_ERR_CODE xaf_disconnect(xaf_comp_t *p_comp); -*/ - -XAF_ERR_CODE xaf_comp_get_status(void *p_adev, void *p_comp, xaf_comp_status *p_status, xaf_info_t *p_info); - -/* ...check null pointer */ -#define XAF_CHK_PTR(ptr) \ -({ \ - int __ret; \ - \ - if ((__ret = (int)(ptr)) == 0) \ - { \ - TRACE(ERROR, _x("Null pointer error: %d"), __ret); \ - return XAF_PTR_ERROR; \ - } \ - __ret; \ -}) - -/* ...check range */ -#define XAF_CHK_RANGE(val, min, max) \ -({ \ - int __ret = val; \ - \ - if ((__ret < (int)min) || (__ret > (int)max)) \ - { \ - TRACE(ERROR, _x("Invalid value: %d"), __ret); \ - return XAF_INVALID_VALUE; \ - } \ - __ret; \ -}) - - - - diff --git a/hifi/xaf/host-apf/include/xaf-structs.h b/hifi/xaf/host-apf/include/xaf-structs.h deleted file mode 100644 index f632600a..00000000 --- a/hifi/xaf/host-apf/include/xaf-structs.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/* ...size of auxiliary pool for communication with HiFi */ -#define XAF_AUX_POOL_SIZE 32 - -/* ...length of auxiliary pool messages */ -#define XAF_AUX_POOL_MSG_LENGTH 128 -#define XAF_MAX_CONFIG_PARAMS (XAF_AUX_POOL_MSG_LENGTH >> 3) - -typedef struct xaf_comp xaf_comp_t; - -struct xaf_comp { - xf_handle_t handle; - - u32 inp_routed; - u32 out_routed; - u32 inp_ports; - u32 out_ports; - u32 init_done; - u32 pending_resp; - u32 expect_out_cmd; - u32 input_over; - - xaf_comp_type comp_type; - xaf_comp_status comp_status; - u32 start_cmd_issued; - u32 exec_cmd_issued; - void *start_buf; - - xaf_format_t inp_format; - xaf_format_t out_format; - - xf_pool_t *inpool; - xf_pool_t *outpool; - u32 noutbuf; - - xaf_comp_t *next; - - u32 ninbuf; - void *p_adev; - //xaf_comp_state comp_state; - void *comp_ptr; -}; - -typedef struct xaf_adev_s { - xf_proxy_t proxy; - xaf_comp_t *comp_chain; - - u32 n_comp; - void *adev_ptr; - void *p_dspMem; - void *p_apMem; - void *p_dspLocalBuff; - void *p_apSharedMem; - - xaf_ap_utils_t *p_ap_utils; //host-side utility structure handle - void *(*pxf_mem_malloc_fxn)(s32, s32); - void (*pxf_mem_free_fxn)(void *,s32); - //xaf_adev_state adev_state; - -} xaf_adev_t; - diff --git a/hifi/xaf/host-apf/include/xf-debug.h b/hifi/xaf/host-apf/include/xf-debug.h deleted file mode 100644 index 83172302..00000000 --- a/hifi/xaf/host-apf/include/xf-debug.h +++ /dev/null @@ -1,194 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-debug.h mustn't be included directly" -#endif - -/******************************************************************************* - * Auxiliary macros (put into "xf-types.h"?) - ******************************************************************************/ - -#ifndef offset_of -#define offset_of(type, member) \ - ((int)(intptr_t)&(((const type *)(0))->member)) -#endif - -#ifndef container_of -#define container_of(ptr, type, member) \ - ((type *)((void *)(ptr) - offset_of(type, member))) -#endif - -/******************************************************************************* - * Bug check for constant conditions (file scope) - ******************************************************************************/ - -#define __C_BUG(n) __C_BUG2(n) -#define __C_BUG2(n) __c_bug_##n -#define C_BUG(expr) typedef char __C_BUG(__LINE__)[(expr) ? -1 : 1] - -/******************************************************************************* - * Compilation-time types control - ******************************************************************************/ - -#if XF_DEBUG -#define __C_TYPE_CONTROL(d, type) ((void) ((d) != (type*) 0)) -#else -#define __C_TYPE_CONTROL(d, type) ((void) 0) -#endif - -/******************************************************************************* - * Unused variable - ******************************************************************************/ - -#define C_UNUSED(v) (void)(0 ? (v) = (v), 1 : 0) - -/******************************************************************************* - * Auxiliary macros - ******************************************************************************/ - -/* ...define a stub for unused declarator */ -#define __xf_stub(tag, line) __xf_stub2(tag, line) -#define __xf_stub2(tag, line) typedef int __xf_##tag##_##line - -/* ...convert anything into string */ -#define __xf_string(x) __xf_string2(x) -#define __xf_string2(x) #x - -/******************************************************************************* - * Tracing facility - ******************************************************************************/ - -#if XF_TRACE - -/* ...tracing to communication processor */ -extern int xf_trace(const char *format, ...); - -/* ...tracing facility initialization */ -extern void xf_trace_init(const char *banner); - -/* ...initialize tracing facility */ -#define TRACE_INIT(banner) (xf_trace_init(banner)) - -/* ...trace tag definition */ -#define TRACE_TAG(tag, on) enum { __xf_trace_##tag = on } - -/* ...check if the trace tag is enabled */ -#define TRACE_CFG(tag) (__xf_trace_##tag) - -/* ...tagged tracing primitive */ -#define TRACE(tag, fmt, ...) (void)(__xf_trace_##tag ? __xf_trace(tag, __xf_format##fmt, ## __VA_ARGS__), 1 : 0) - -/******************************************************************************* - * Tagged tracing formats - ******************************************************************************/ - -/* ...tracing primitive */ -#define __xf_trace(tag, fmt, ...) \ - ({ __attribute__((unused)) const char *__xf_tag = #tag; xf_trace(fmt, ## __VA_ARGS__); }) - -/* ...just a format string */ -#define __xf_format_n(fmt) fmt - -/* ...module tag and trace tag shown */ -#define __xf_format_b(fmt) "[%s.%s] " fmt, __xf_string(MODULE_TAG), __xf_tag - -/* ...module tag, trace tag, file name and line shown */ -#define __xf_format_x(fmt) "[%s.%s] - %s@%d - " fmt, __xf_string(MODULE_TAG), __xf_tag, __FILE__, __LINE__ - -/******************************************************************************* - * Globally defined tags - ******************************************************************************/ - -/* ...unconditionally OFF */ -TRACE_TAG(0, 0); - -/* ...unconditionally ON */ -TRACE_TAG(1, 1); - -/* ...error output - on by default */ -TRACE_TAG(ERROR, 1); - -#else - -#define TRACE_INIT(banner) (void)0 -#define TRACE_TAG(tag, on) __xf_stub(trace_##tag, __LINE__) -#define TRACE(tag, fmt, ...) (void)0 -#define __xf_trace(tag, fmt, ...) (void)0 - -#endif /* XF_TRACE */ - -/******************************************************************************* - * Bugchecks - ******************************************************************************/ - -#if XF_DEBUG - -/* ...run-time bugcheck */ -#define BUG(cond, fmt, ...) \ -do \ -{ \ - if (cond) \ - { \ - /* ...output message */ \ - __xf_trace(BUG, __xf_format##fmt, ## __VA_ARGS__); \ - \ - /* ...and die */ \ - abort(); \ - } \ -} \ -while (0) - -#else -#define BUG(cond, fmt, ...) (void)0 -#endif /* XF_DEBUG */ - -/******************************************************************************* - * Run-time error processing - ******************************************************************************/ - -/* ...check the API call succeeds */ -#define XF_CHK_API(cond) \ -({ \ - int __ret; \ - \ - if ((__ret = (int)(cond)) < 0) \ - { \ - TRACE(ERROR, _x("API error: %d"), __ret); \ - return __ret; \ - } \ - __ret; \ -}) - -/* ...check the condition is true */ -#define XF_CHK_ERR(cond, error) \ -({ \ - intptr_t __ret; \ - \ - if (!(__ret = (intptr_t)(cond))) \ - { \ - TRACE(ERROR, _x("check failed")); \ - return (error); \ - } \ - (int)__ret; \ -}) - diff --git a/hifi/xaf/host-apf/include/xf-opcode.h b/hifi/xaf/host-apf/include/xf-opcode.h deleted file mode 100644 index f585f5c2..00000000 --- a/hifi/xaf/host-apf/include/xf-opcode.h +++ /dev/null @@ -1,297 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-opcode.h mustn't be included directly" -#endif - -/******************************************************************************* - * Message routing composition - move somewhere else - tbd - ******************************************************************************/ - -/* ...adjust IPC client of message going from user-space */ -#define XF_MSG_AP_FROM_USER(id, client) \ - (((id) & ~(0xF << 2)) | (client)) - -/* ...wipe out IPC client from message going to user-space */ -#define XF_MSG_AP_TO_USER(id) \ - ((id) & ~(0xF << 18)) - -/* ...port specification (12 bits) */ -#define __XF_PORT_SPEC(core, id, port) ((core) | ((id) << 2) | ((port) << 8)) -#define __XF_PORT_SPEC2(id, port) ((id) | ((port) << 8)) -#define XF_PORT_CORE(spec) ((spec) & 0x3) -#define XF_PORT_CLIENT(spec) (((spec) >> 2) & 0x3F) -#define XF_PORT_ID(spec) (((spec) >> 8) & 0xF) - -/* ...message id contains source and destination ports specification */ -#define __XF_MSG_ID(src, dst) (((src) & 0xFFFF) | (((dst) & 0xFFFF) << 16)) -#define XF_MSG_SRC(id) (((id) >> 0) & 0xFFFF) -#define XF_MSG_SRC_CORE(id) (((id) >> 0) & 0x3) -#define XF_MSG_SRC_CLIENT(id) (((id) >> 2) & 0x3F) -#define XF_MSG_SRC_ID(id) (((id) >> 0) & 0xFF) -#define XF_MSG_SRC_PORT(id) (((id) >> 8) & 0xF) -#define XF_MSG_SRC_PROXY(id) (((id) >> 15) & 0x1) -#define XF_MSG_DST(id) (((id) >> 16) & 0xFFFF) -#define XF_MSG_DST_CORE(id) (((id) >> 16) & 0x3) -#define XF_MSG_DST_CLIENT(id) (((id) >> 18) & 0x3F) -#define XF_MSG_DST_ID(id) (((id) >> 16) & 0xFF) -#define XF_MSG_DST_PORT(id) (((id) >> 24) & 0xF) -#define XF_MSG_DST_PROXY(id) (((id) >> 31) & 0x1) - -/* ...special treatment of AP-proxy destination field */ -#define XF_AP_IPC_CLIENT(id) (((id) >> 18) & 0xF) -#define XF_AP_CLIENT(id) (((id) >> 22) & 0x1FF) -#define __XF_AP_PROXY(core) ((core) | 0x8000) -#define __XF_DSP_PROXY(core) ((core) | 0x8000) -#define __XF_AP_CLIENT(core, client) ((core) | ((client) << 6) | 0x8000) - -/******************************************************************************* - * Opcode composition - ******************************************************************************/ - -/* ...opcode composition with command/response data tags */ -#define __XF_OPCODE(c, r, op) (((c) << 31) | ((r) << 30) | ((op) & 0x3F)) - -/* ...accessors */ -#define XF_OPCODE_CDATA(opcode) ((opcode) & (1 << 31)) -#define XF_OPCODE_RDATA(opcode) ((opcode) & (1 << 30)) -#define XF_OPCODE_TYPE(opcode) ((opcode) & (0x3F)) - -/******************************************************************************* - * Opcode types - ******************************************************************************/ - -/* ...unregister client */ -#define XF_UNREGISTER __XF_OPCODE(0, 0, 0) - -/* ...register client at proxy */ -#define XF_REGISTER __XF_OPCODE(1, 0, 1) - -/* ...port routing command */ -#define XF_ROUTE __XF_OPCODE(1, 0, 2) - -/* ...port unrouting command */ -#define XF_UNROUTE __XF_OPCODE(1, 0, 3) - -/* ...shared buffer allocation */ -#define XF_ALLOC __XF_OPCODE(0, 0, 4) - -/* ...shared buffer freeing */ -#define XF_FREE __XF_OPCODE(0, 0, 5) - -/* ...set component parameters */ -#define XF_SET_PARAM __XF_OPCODE(1, 0, 6) - -/* ...get component parameters */ -#define XF_GET_PARAM __XF_OPCODE(1, 1, 7) - -/* ...input buffer reception */ -#define XF_EMPTY_THIS_BUFFER __XF_OPCODE(1, 0, 8) - -/* ...output buffer reception */ -#define XF_FILL_THIS_BUFFER __XF_OPCODE(0, 1, 9) - -/* ...flush specific port */ -#define XF_FLUSH __XF_OPCODE(0, 0, 10) - -/* ...start component operation */ -#define XF_START __XF_OPCODE(0, 0, 11) - -/* ...stop component operation */ -#define XF_STOP __XF_OPCODE(0, 0, 12) - -/* ...pause component operation */ -#define XF_PAUSE __XF_OPCODE(0, 0, 13) - -/* ...resume component operation */ -#define XF_RESUME __XF_OPCODE(0, 0, 14) - -/* ...extended parameter setting function */ -#define XF_SET_PARAM_EXT __XF_OPCODE(1, 1, 15) - -/* ...extended parameter retrieval function */ -#define XF_GET_PARAM_EXT __XF_OPCODE(1, 1, 16) - -/* ...total amount of supported decoder commands */ -#define __XF_OP_NUM 17 - -/******************************************************************************* - * XF_START message definition - ******************************************************************************/ - -typedef struct xf_start_msg -{ - /* ...effective sample rate */ - u32 sample_rate; - - /* ...number of channels */ - u32 channels; - - /* ...sample width */ - u32 pcm_width; - - /* ...minimal size of intput buffer */ - u32 input_length; - - /* ...size of output buffer */ - u32 output_length; - -} __attribute__((__packed__)) xf_start_msg_t; - -/******************************************************************************* - * XF_GET_PARAM message - ******************************************************************************/ - -/* ...message body (command/response) */ -typedef union xf_get_param_msg -{ - /* ...command structure */ - struct - { - /* ...array of parameters requested */ - u32 id[0]; - - } __attribute__((__packed__)) c; - - /* ...response structure */ - struct - { - /* ...array of parameters values */ - u32 value[0]; - - } __attribute__((__packed__)) r; - -} xf_get_param_msg_t; - -/* ...length of the XF_GET_PARAM command/response */ -#define XF_GET_PARAM_CMD_LEN(params) (sizeof(u32) * (params)) -#define XF_GET_PARAM_RSP_LEN(params) (sizeof(u32) * (params)) - -/******************************************************************************* - * XF_SET_PARAM message - ******************************************************************************/ - -/* ...component initialization parameter */ -typedef struct xf_set_param_item -{ - /* ...index of parameter passed to SET_CONFIG_PARAM call */ - u32 id; - - /* ...value of parameter */ - u32 value; - -} __attribute__ ((__packed__)) xf_set_param_item_t; - -/* ...message body (no response message? - tbd) */ -typedef struct xf_set_param_msg -{ - /* ...command message */ - xf_set_param_item_t item[0]; - -} __attribute__ ((__packed__)) xf_set_param_msg_t; - -/* ...length of the command message */ -#define XF_SET_PARAM_CMD_LEN(params) (sizeof(xf_set_param_item_t) * (params)) - -/******************************************************************************* - * XF_SET_PARAM_EXT/XF_GET_PARAM_EXT message - ******************************************************************************/ - -/* ...extended parameter descriptor */ -typedef struct xf_ext_param_desc -{ - /* ...index of parameter passed to SET/GET_CONFIG_PARAM call (16-bits only) */ - u16 id; - - /* ...length of embedded input/output parameter data (in bytes) */ - u16 length; - -} __attribute__ ((__packed__, __aligned__(4))) xf_ext_param_desc_t; - -/* ...message body (no response message? - tbd) */ -typedef struct xf_ext_param_msg -{ - /* ...extended parameter descriptor */ - xf_ext_param_desc_t desc; - - /* ...parameter data (in the format expected by codec) */ - u8 data[0]; - -} __attribute__ ((__packed__)) xf_ext_param_msg_t; - -/* ...access macros */ - -#define xf_ext_param_first(e) \ - (&(e)->desc) - -#define xf_ext_param_next(d) \ - (xf_ext_param_desc_t *)(((xf_ext_param_msg_t *)(d))->data + (((d)->length + 3) & ~3)) - -#define xf_ext_param_length(e, d) \ - ((u32)((u8 *)(d) - (u8 *)(ext))) - -#define xf_ext_param_data(d, t) \ - ((t *)&(d)[1]) - -#define xf_ext_param_setup(d, i, t, s) \ - ((d)->id = (i), (d)->length = (s), xf_ext_param_data(d, t)) - - -/******************************************************************************* - * XF_ROUTE definition - ******************************************************************************/ - -/* ...port routing command */ -typedef struct xf_route_port_msg -{ - /* ...source port specification */ - u32 src; - - /* ...destination port specification */ - u32 dst; - - /* ...number of buffers to allocate */ - u32 alloc_number; - - /* ...length of buffer to allocate */ - u32 alloc_size; - - /* ...alignment restriction for a buffer */ - u32 alloc_align; - -} __attribute__((__packed__)) xf_route_port_msg_t; - -/******************************************************************************* - * XF_UNROUTE definition - ******************************************************************************/ - -/* ...port unrouting command */ -typedef struct xf_unroute_port_msg -{ - /* ...source port specification */ - u32 src; - - /* ...destination port specification */ - u32 dst; - -} __attribute__((__packed__)) xf_unroute_port_msg_t; diff --git a/hifi/xaf/host-apf/include/xf-proto.h b/hifi/xaf/host-apf/include/xf-proto.h deleted file mode 100644 index 095e353a..00000000 --- a/hifi/xaf/host-apf/include/xf-proto.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-proto.h mustn't be included directly" -#endif - -/******************************************************************************* - * Forward types declarations - ******************************************************************************/ - -/* ...component string identifier */ -typedef const char *xf_id_t; - -/* ...handle to proxy data */ -typedef struct xf_proxy xf_proxy_t; - -/* ...handle to component data */ -typedef struct xf_handle xf_handle_t; - -/* ...buffer pool */ -typedef struct xf_pool xf_pool_t; - -/* ...individual buffer from pool */ -typedef struct xf_buffer xf_buffer_t; - -/* ...buffer pool type */ -typedef u32 xf_pool_type_t; - -/* ...user-message */ -typedef struct xf_user_msg xf_user_msg_t; - -/* ...proxy-message */ -typedef struct xf_proxy_msg xf_proxy_msg_t; - -/* ...response callback */ -typedef void (*xf_response_cb)(xf_handle_t *h, xf_user_msg_t *msg); - -typedef void* xaf_mem_malloc_fxn_t(s32 size, s32 id); -typedef void xaf_mem_free_fxn_t(void* ptr, s32 id); - -/******************************************************************************* - * High-level API functions - ******************************************************************************/ - -/* ...component operations */ -extern int xf_open(xf_proxy_t *proxy, xf_handle_t *handle, xf_id_t id, u32 core, xf_response_cb cb); -extern void xf_close(xf_handle_t *handle); -extern int xf_command(xf_handle_t *handle, u32 dst, u32 opcode, void *buf, u32 length); -extern int xf_route(xf_handle_t *src, u32 s_port, xf_handle_t *dst, u32 d_port, u32 num, u32 size, u32 align); -extern int xf_unroute(xf_handle_t *src, u32 s_port); - -/* ...shared buffers operations */ -extern int xf_pool_alloc(xf_proxy_t *proxy, u32 number, u32 length, xf_pool_type_t type, xf_pool_t **pool, s32 id, - xaf_mem_malloc_fxn_t, xaf_mem_free_fxn_t); -extern void xf_pool_free(xf_pool_t *pool, s32 id, xaf_mem_free_fxn_t); -extern xf_buffer_t * xf_buffer_get(xf_pool_t *pool); -extern void xf_buffer_put(xf_buffer_t *buffer); - -/* ...proxy operations */ -extern int xf_proxy_init(xf_proxy_t *proxy, u32 core, void *p_shmem); -extern void xf_proxy_close(xf_proxy_t *proxy); - diff --git a/hifi/xaf/host-apf/include/xf-proxy.h b/hifi/xaf/host-apf/include/xf-proxy.h deleted file mode 100644 index 90d70793..00000000 --- a/hifi/xaf/host-apf/include/xf-proxy.h +++ /dev/null @@ -1,297 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef __XF_H -#error "xf-proxy.h mustn't be included directly" -#endif - -/******************************************************************************* - * User-message description - move from here to API - tbd - ******************************************************************************/ - -/* ...need that at all? hope no */ -struct xf_user_msg -{ - /* ...source component specification */ - u32 id; - - /* ...message opcode */ - u32 opcode; - - /* ...buffer length */ - u32 length; - - /* ...buffer pointer */ - void *buffer; -}; - -/* ...proxy message - bad placing of that thing here - tbd */ -struct xf_proxy_msg -{ - /* ...session-id field */ - uint32_t id; - - /* ...message opcode */ - uint32_t opcode; - - /* ...buffer length */ - uint32_t length; - - /* ...buffer pointer */ - uint64_t address; - uint64_t v_address; - -} __attribute__((__packed__)); - -typedef struct xf_proxy_msg_driv -{ - /* ...session ID */ - uint32_t id; - - /* ...proxy API command/reponse code */ - uint32_t opcode; - - /* ...length of attached buffer */ - uint32_t length; - - /* ...physical address of message buffer */ - uint64_t address; - uint64_t v_address; - -}__attribute__((__packed__)) xf_proxy_message_driv_t; -/******************************************************************************* - * Buffer pools - ******************************************************************************/ - -/* ...buffer pool type */ -enum xf_pool_type -{ - XF_POOL_AUX = 0, - XF_POOL_INPUT = 1, - XF_POOL_OUTPUT = 2 -}; - -/* ...buffer link pointer */ -typedef union xf_buffer_link -{ - /* ...pointer to next free buffer in a pool (for free buffer) */ - xf_buffer_t *next; - - /* ...reference to a buffer pool (for allocated buffer) */ - xf_pool_t *pool; - -} xf_buffer_link_t; - -/* ...buffer descriptor */ -struct xf_buffer -{ - /* ...virtual address of contiguous buffer */ - void *address; - - /* ...link pointer */ - xf_buffer_link_t link; -}; - -/* ...buffer pool */ -struct xf_pool -{ - /* ...reference to proxy data */ - xf_proxy_t *proxy; - - /* ...length of individual buffer in a pool */ - u32 length; - - /* ...number of buffers in a pool */ - u32 number; - - /* ...pointer to pool memory */ - void *p; - - /* ...pointer to first free buffer in a pool */ - xf_buffer_t *free; - - /* ...individual buffers */ - xf_buffer_t buffer[0]; -}; - -/* ...accessor to buffer data */ -static inline void * xf_buffer_data(xf_buffer_t *buffer) -{ - return buffer->address; -} - -/* ...length of buffer data */ -static inline size_t xf_buffer_length(xf_buffer_t *buffer) -{ - return buffer->link.pool->length; -} - -/******************************************************************************* - * Proxy handle definition - ******************************************************************************/ - -/* ...free clients list */ -typedef union xf_proxy_cmap_link -{ - /* ...index of next free client in the list */ - u32 next; - - /* ...pointer to allocated component handle */ - xf_handle_t *handle; - -} xf_proxy_cmap_link_t; - -/* ...proxy data structure */ -struct xf_proxy -{ - /* ...platform-specific IPC data */ - xf_proxy_ipc_data_t ipc; - - /* ...auxiliary buffer pool for clients */ - xf_pool_t *aux; - - /* ...global proxy lock */ - xf_lock_t lock; - - /* ...proxy thread handle */ - xf_thread_t thread; - - /* ...proxy identifier (core of remote DSP hosting SHMEM interface) */ - u32 core; - - /* ...client association map */ - xf_proxy_cmap_link_t cmap[XF_CFG_PROXY_MAX_CLIENTS]; -}; - -/******************************************************************************* - * Auxiliary proxy helpers - ******************************************************************************/ - -/* ...get proxy identifier */ -static inline u32 xf_proxy_id(xf_proxy_t *proxy) -{ - return proxy->core; -} - -/* ...lock proxy data */ -static inline void xf_proxy_lock(xf_proxy_t *proxy) -{ - __xf_lock(&proxy->lock); -} - -/* ...unlock proxy data */ -static inline void xf_proxy_unlock(xf_proxy_t *proxy) -{ - __xf_unlock(&proxy->lock); -} - -/* ...translate proxy shared address into local virtual address */ -static inline void * xf_proxy_a2b(xf_proxy_t *proxy, u32 address) -{ - return xf_ipc_a2b(&proxy->ipc, address); -} - -/* ...translate local virtual address into shared proxy address */ -static inline u32 xf_proxy_b2a(xf_proxy_t *proxy, void *b) -{ - return xf_ipc_b2a(&proxy->ipc, b); -} - -/* ...submit asynchronous response message */ -static inline int xf_proxy_response_put(xf_proxy_t *proxy, xf_proxy_msg_t *msg) -{ - return xf_proxy_ipc_response_put(&proxy->ipc, msg); -} - -/* ...retrieve asynchronous response message */ -static inline int xf_proxy_response_get(xf_proxy_t *proxy, xf_proxy_msg_t *msg) -{ - return xf_proxy_ipc_response_get(&proxy->ipc, msg); -} - -/******************************************************************************* - * Component handle definition - ******************************************************************************/ - -struct xf_handle -{ - /* ...platform-specific IPC data */ - xf_ipc_data_t ipc; - - /* ...reference to proxy data */ - xf_proxy_t *proxy; - - /* ...component lock */ - xf_lock_t lock; - - /* ...auxiliary control buffer for control transactions */ - xf_buffer_t *aux; - - /* ...global client-id of the component */ - u32 id; - - /* ...local client number (think about merging into "id" field - tbd) */ - u32 client; - - /* ...response processing hook */ - xf_response_cb response; -}; - -/******************************************************************************* - * Auxiliary component helpers - ******************************************************************************/ - -/* ...component client-id (global scope) */ -static inline u32 xf_handle_id(xf_handle_t *handle) -{ - return handle->id; -} - -/* ...pointer to auxiliary buffer */ -static inline void * xf_handle_aux(xf_handle_t *handle) -{ - return xf_buffer_data(handle->aux); -} - -/* ...acquire component lock */ -static inline void xf_lock(xf_handle_t *handle) -{ - __xf_lock(&handle->lock); -} - -/* ...release component lock */ -static inline void xf_unlock(xf_handle_t *handle) -{ - __xf_unlock(&handle->lock); -} - -/* ...put asynchronous response into local IPC */ -static inline int xf_response_put(xf_handle_t *handle, xf_user_msg_t *msg) -{ - return xf_ipc_response_put(&handle->ipc, msg); -} - -/* ...get asynchronous response from local IPC */ -static inline int xf_response_get(xf_handle_t *handle, xf_user_msg_t *msg) -{ - return xf_ipc_response_get(&handle->ipc, msg); -} diff --git a/hifi/xaf/host-apf/include/xf.h b/hifi/xaf/host-apf/include/xf.h deleted file mode 100644 index 6af69ce6..00000000 --- a/hifi/xaf/host-apf/include/xf.h +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifdef __XF_H -#error "xf.h included more than once" -#endif - -#define __XF_H - -/******************************************************************************* - * Common runtime framework - ******************************************************************************/ - -/* ...target configuration */ -#include "xf-config.h" - -/* ...platform run-time */ -#include "xf-runtime.h" - -/* ...debugging facility */ -#include "xf-debug.h" - -/* ...API prototypes */ -#include "xf-proto.h" - -/* ...standard opcodes */ -#include "xf-opcode.h" - -/* ...platform-specific IPC layer */ -#include "xf-ipc.h" - -/* ...proxy definitions */ -#include "xf-proxy.h" - diff --git a/hifi/xaf/host-apf/playback/tinyalsa/asoundlib.h b/hifi/xaf/host-apf/playback/tinyalsa/asoundlib.h deleted file mode 100644 index 753a996b..00000000 --- a/hifi/xaf/host-apf/playback/tinyalsa/asoundlib.h +++ /dev/null @@ -1,314 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#ifndef ASOUNDLIB_H -#define ASOUNDLIB_H - -#include <sys/time.h> -#include <stddef.h> - -#if defined(__cplusplus) -extern "C" { -#endif - -/* - * PCM API - */ - -struct pcm; - -#define PCM_OUT 0x00000000 -#define PCM_IN 0x10000000 -#define PCM_MMAP 0x00000001 -#define PCM_NOIRQ 0x00000002 -#define PCM_NORESTART 0x00000004 /* PCM_NORESTART - when set, calls to - * pcm_write for a playback stream will not - * attempt to restart the stream in the case - * of an underflow, but will return -EPIPE - * instead. After the first -EPIPE error, the - * stream is considered to be stopped, and a - * second call to pcm_write will attempt to - * restart the stream. - */ -#define PCM_MONOTONIC 0x00000008 /* see pcm_get_htimestamp */ - -/* PCM runtime states */ -#define PCM_STATE_OPEN 0 -#define PCM_STATE_SETUP 1 -#define PCM_STATE_PREPARED 2 -#define PCM_STATE_RUNNING 3 -#define PCM_STATE_XRUN 4 -#define PCM_STATE_DRAINING 5 -#define PCM_STATE_PAUSED 6 -#define PCM_STATE_SUSPENDED 7 -#define PCM_STATE_DISCONNECTED 8 - -/* TLV header size*/ -#define TLV_HEADER_SIZE (2 * sizeof(unsigned int)) - -/* Bit formats */ -enum pcm_format { - PCM_FORMAT_INVALID = -1, - PCM_FORMAT_S16_LE = 0, /* 16-bit signed */ - PCM_FORMAT_S32_LE, /* 32-bit signed */ - PCM_FORMAT_S8, /* 8-bit signed */ - PCM_FORMAT_S24_LE, /* 24-bits in 4-bytes */ - PCM_FORMAT_S24_3LE, /* 24-bits in 3-bytes */ - - PCM_FORMAT_MAX, -}; - -/* Bitmask has 256 bits (32 bytes) in asound.h */ -struct pcm_mask { - unsigned int bits[32 / sizeof(unsigned int)]; -}; - -/* Configuration for a stream */ -struct pcm_config { - unsigned int channels; - unsigned int rate; - unsigned int period_size; - unsigned int period_count; - enum pcm_format format; - - /* Values to use for the ALSA start, stop and silence thresholds, and - * silence size. Setting any one of these values to 0 will cause the - * default tinyalsa values to be used instead. - * Tinyalsa defaults are as follows. - * - * start_threshold : period_count * period_size - * stop_threshold : period_count * period_size - * silence_threshold : 0 - * silence_size : 0 - */ - unsigned int start_threshold; - unsigned int stop_threshold; - unsigned int silence_threshold; - unsigned int silence_size; - - /* Minimum number of frames available before pcm_mmap_write() will actually - * write into the kernel buffer. Only used if the stream is opened in mmap mode - * (pcm_open() called with PCM_MMAP flag set). Use 0 for default. - */ - int avail_min; -}; - -/* PCM parameters */ -enum pcm_param -{ - /* mask parameters */ - PCM_PARAM_ACCESS, - PCM_PARAM_FORMAT, - PCM_PARAM_SUBFORMAT, - /* interval parameters */ - PCM_PARAM_SAMPLE_BITS, - PCM_PARAM_FRAME_BITS, - PCM_PARAM_CHANNELS, - PCM_PARAM_RATE, - PCM_PARAM_PERIOD_TIME, - PCM_PARAM_PERIOD_SIZE, - PCM_PARAM_PERIOD_BYTES, - PCM_PARAM_PERIODS, - PCM_PARAM_BUFFER_TIME, - PCM_PARAM_BUFFER_SIZE, - PCM_PARAM_BUFFER_BYTES, - PCM_PARAM_TICK_TIME, -}; - -/* Mixer control types */ -enum mixer_ctl_type { - MIXER_CTL_TYPE_BOOL, - MIXER_CTL_TYPE_INT, - MIXER_CTL_TYPE_ENUM, - MIXER_CTL_TYPE_BYTE, - MIXER_CTL_TYPE_IEC958, - MIXER_CTL_TYPE_INT64, - MIXER_CTL_TYPE_UNKNOWN, - - MIXER_CTL_TYPE_MAX, -}; - -/* Open and close a stream */ -struct pcm *pcm_open(unsigned int card, unsigned int device, - unsigned int flags, struct pcm_config *config); -int pcm_close(struct pcm *pcm); -int pcm_is_ready(struct pcm *pcm); - -/* Obtain the parameters for a PCM */ -struct pcm_params *pcm_params_get(unsigned int card, unsigned int device, - unsigned int flags); -void pcm_params_free(struct pcm_params *pcm_params); - -struct pcm_mask *pcm_params_get_mask(struct pcm_params *pcm_params, - enum pcm_param param); -unsigned int pcm_params_get_min(struct pcm_params *pcm_params, - enum pcm_param param); -void pcm_params_set_min(struct pcm_params *pcm_params, - enum pcm_param param, unsigned int val); -unsigned int pcm_params_get_max(struct pcm_params *pcm_params, - enum pcm_param param); -void pcm_params_set_max(struct pcm_params *pcm_params, - enum pcm_param param, unsigned int val); - -/* Converts the pcm parameters to a human readable string. - * The string parameter is a caller allocated buffer of size bytes, - * which is then filled up to size - 1 and null terminated, - * if size is greater than zero. - * The return value is the number of bytes copied to string - * (not including null termination) if less than size; otherwise, - * the number of bytes required for the buffer. - */ -int pcm_params_to_string(struct pcm_params *params, char *string, unsigned int size); - -/* Returns 1 if the pcm_format is present (format bit set) in - * the pcm_params structure; 0 otherwise, or upon unrecognized format. - */ -int pcm_params_format_test(struct pcm_params *params, enum pcm_format format); - -/* Set and get config */ -int pcm_get_config(struct pcm *pcm, struct pcm_config *config); -int pcm_set_config(struct pcm *pcm, struct pcm_config *config); - -/* Returns a human readable reason for the last error */ -const char *pcm_get_error(struct pcm *pcm); - -/* Returns the sample size in bits for a PCM format. - * As with ALSA formats, this is the storage size for the format, whereas the - * format represents the number of significant bits. For example, - * PCM_FORMAT_S24_LE uses 32 bits of storage. - */ -unsigned int pcm_format_to_bits(enum pcm_format format); - -/* Returns the buffer size (int frames) that should be used for pcm_write. */ -unsigned int pcm_get_buffer_size(struct pcm *pcm); -unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); -unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int bytes); - -/* Returns the pcm latency in ms */ -unsigned int pcm_get_latency(struct pcm *pcm); - -/* Returns available frames in pcm buffer and corresponding time stamp. - * The clock is CLOCK_MONOTONIC if flag PCM_MONOTONIC was specified in pcm_open, - * otherwise the clock is CLOCK_REALTIME. - * For an input stream, frames available are frames ready for the - * application to read. - * For an output stream, frames available are the number of empty frames available - * for the application to write. - */ -int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, - struct timespec *tstamp); - -/* Returns the subdevice on which the pcm has been opened */ -unsigned int pcm_get_subdevice(struct pcm *pcm); - -/* Write data to the fifo. - * Will start playback on the first write or on a write that - * occurs after a fifo underrun. - */ -int pcm_write(struct pcm *pcm, const void *data, unsigned int count); -int pcm_read(struct pcm *pcm, void *data, unsigned int count); - -/* - * mmap() support. - */ -int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count); -int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count); -int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, - unsigned int *frames); -int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames); -int pcm_mmap_avail(struct pcm *pcm); - -/* Prepare the PCM substream to be triggerable */ -int pcm_prepare(struct pcm *pcm); -/* Start and stop a PCM channel that doesn't transfer data */ -int pcm_start(struct pcm *pcm); -int pcm_stop(struct pcm *pcm); - -/* ioctl function for PCM driver */ -int pcm_ioctl(struct pcm *pcm, int request, ...); - -/* Interrupt driven API */ -int pcm_wait(struct pcm *pcm, int timeout); -int pcm_get_poll_fd(struct pcm *pcm); - -/* Change avail_min after the stream has been opened with no need to stop the stream. - * Only accepted if opened with PCM_MMAP and PCM_NOIRQ flags - */ -int pcm_set_avail_min(struct pcm *pcm, int avail_min); - -/* - * MIXER API - */ - -struct mixer; -struct mixer_ctl; - -/* Open and close a mixer */ -struct mixer *mixer_open(unsigned int card); -void mixer_close(struct mixer *mixer); - -/* Get info about a mixer */ -const char *mixer_get_name(struct mixer *mixer); - -/* Obtain mixer controls */ -unsigned int mixer_get_num_ctls(struct mixer *mixer); -struct mixer_ctl *mixer_get_ctl(struct mixer *mixer, unsigned int id); -struct mixer_ctl *mixer_get_ctl_by_name(struct mixer *mixer, const char *name); - -/* Get info about mixer controls */ -const char *mixer_ctl_get_name(struct mixer_ctl *ctl); -enum mixer_ctl_type mixer_ctl_get_type(struct mixer_ctl *ctl); -const char *mixer_ctl_get_type_string(struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_values(struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_enums(struct mixer_ctl *ctl); -const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, - unsigned int enum_id); - -/* Some sound cards update their controls due to external events, - * such as HDMI EDID byte data changing when an HDMI cable is - * connected. This API allows the count of elements to be updated. - */ -void mixer_ctl_update(struct mixer_ctl *ctl); - -/* Set and get mixer controls */ -int mixer_ctl_get_percent(struct mixer_ctl *ctl, unsigned int id); -int mixer_ctl_set_percent(struct mixer_ctl *ctl, unsigned int id, int percent); - -int mixer_ctl_get_value(struct mixer_ctl *ctl, unsigned int id); -int mixer_ctl_is_access_tlv_rw(struct mixer_ctl *ctl); -int mixer_ctl_get_array(struct mixer_ctl *ctl, void *array, size_t count); -int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value); -int mixer_ctl_set_array(struct mixer_ctl *ctl, const void *array, size_t count); -int mixer_ctl_set_enum_by_string(struct mixer_ctl *ctl, const char *string); - -/* Determe range of integer mixer controls */ -int mixer_ctl_get_range_min(struct mixer_ctl *ctl); -int mixer_ctl_get_range_max(struct mixer_ctl *ctl); - -int mixer_subscribe_events(struct mixer *mixer, int subscribe); -int mixer_wait_event(struct mixer *mixer, int timeout); - -#if defined(__cplusplus) -} /* extern "C" */ -#endif - -#endif diff --git a/hifi/xaf/host-apf/playback/tinyalsa/pcm.c b/hifi/xaf/host-apf/playback/tinyalsa/pcm.c deleted file mode 100644 index e0dc7bb7..00000000 --- a/hifi/xaf/host-apf/playback/tinyalsa/pcm.c +++ /dev/null @@ -1,1311 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <stdarg.h> -#include <string.h> -#include <errno.h> -#include <unistd.h> -#include <poll.h> - -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <sys/time.h> -#include <limits.h> - -#include <linux/ioctl.h> -#define __force -//#define __bitwise -#define __user -#include <sound/asound.h> - -#include <tinyalsa/asoundlib.h> - -#define PARAM_MAX SNDRV_PCM_HW_PARAM_LAST_INTERVAL - -/* Logs information into a string; follows snprintf() in that - * offset may be greater than size, and though no characters are copied - * into string, characters are still counted into offset. */ -#define STRLOG(string, offset, size, ...) \ - do { int temp, clipoffset = offset > size ? size : offset; \ - temp = snprintf(string + clipoffset, size - clipoffset, __VA_ARGS__); \ - if (temp > 0) offset += temp; } while (0) - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#endif - -/* refer to SNDRV_PCM_ACCESS_##index in sound/asound.h. */ -static const char * const access_lookup[] = { - "MMAP_INTERLEAVED", - "MMAP_NONINTERLEAVED", - "MMAP_COMPLEX", - "RW_INTERLEAVED", - "RW_NONINTERLEAVED", -}; - -/* refer to SNDRV_PCM_FORMAT_##index in sound/asound.h. */ -static const char * const format_lookup[] = { - /*[0] =*/ "S8", - "U8", - "S16_LE", - "S16_BE", - "U16_LE", - "U16_BE", - "S24_LE", - "S24_BE", - "U24_LE", - "U24_BE", - "S32_LE", - "S32_BE", - "U32_LE", - "U32_BE", - "FLOAT_LE", - "FLOAT_BE", - "FLOAT64_LE", - "FLOAT64_BE", - "IEC958_SUBFRAME_LE", - "IEC958_SUBFRAME_BE", - "MU_LAW", - "A_LAW", - "IMA_ADPCM", - "MPEG", - /*[24] =*/ "GSM", - /* gap */ - [31] = "SPECIAL", - "S24_3LE", - "S24_3BE", - "U24_3LE", - "U24_3BE", - "S20_3LE", - "S20_3BE", - "U20_3LE", - "U20_3BE", - "S18_3LE", - "S18_3BE", - "U18_3LE", - /*[43] =*/ "U18_3BE", -#if 0 - /* recent additions, may not be present on local asound.h */ - "G723_24", - "G723_24_1B", - "G723_40", - "G723_40_1B", - "DSD_U8", - "DSD_U16_LE", -#endif -}; - -/* refer to SNDRV_PCM_SUBFORMAT_##index in sound/asound.h. */ -static const char * const subformat_lookup[] = { - "STD", -}; - -static inline int param_is_mask(int p) -{ - return (p >= SNDRV_PCM_HW_PARAM_FIRST_MASK) && - (p <= SNDRV_PCM_HW_PARAM_LAST_MASK); -} - -static inline int param_is_interval(int p) -{ - return (p >= SNDRV_PCM_HW_PARAM_FIRST_INTERVAL) && - (p <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL); -} - -static inline struct snd_interval *param_to_interval(struct snd_pcm_hw_params *p, int n) -{ - return &(p->intervals[n - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]); -} - -static inline struct snd_mask *param_to_mask(struct snd_pcm_hw_params *p, int n) -{ - return &(p->masks[n - SNDRV_PCM_HW_PARAM_FIRST_MASK]); -} - -static void param_set_mask(struct snd_pcm_hw_params *p, int n, unsigned int bit) -{ - if (bit >= SNDRV_MASK_MAX) - return; - if (param_is_mask(n)) { - struct snd_mask *m = param_to_mask(p, n); - m->bits[0] = 0; - m->bits[1] = 0; - m->bits[bit >> 5] |= (1 << (bit & 31)); - } -} - -static void param_set_min(struct snd_pcm_hw_params *p, int n, unsigned int val) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - i->min = val; - } -} - -static unsigned int param_get_min(struct snd_pcm_hw_params *p, int n) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - return i->min; - } - return 0; -} - -static void param_set_max(struct snd_pcm_hw_params *p, int n, unsigned int val) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - i->max = val; - } -} - -static unsigned int param_get_max(struct snd_pcm_hw_params *p, int n) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - return i->max; - } - return 0; -} - -static void param_set_int(struct snd_pcm_hw_params *p, int n, unsigned int val) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - i->min = val; - i->max = val; - i->integer = 1; - } -} - -static unsigned int param_get_int(struct snd_pcm_hw_params *p, int n) -{ - if (param_is_interval(n)) { - struct snd_interval *i = param_to_interval(p, n); - if (i->integer) - return i->max; - } - return 0; -} - -static void param_init(struct snd_pcm_hw_params *p) -{ - int n; - - memset(p, 0, sizeof(*p)); - for (n = SNDRV_PCM_HW_PARAM_FIRST_MASK; - n <= SNDRV_PCM_HW_PARAM_LAST_MASK; n++) { - struct snd_mask *m = param_to_mask(p, n); - m->bits[0] = ~0; - m->bits[1] = ~0; - } - for (n = SNDRV_PCM_HW_PARAM_FIRST_INTERVAL; - n <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; n++) { - struct snd_interval *i = param_to_interval(p, n); - i->min = 0; - i->max = ~0; - } - p->rmask = ~0U; - p->cmask = 0; - p->info = ~0U; -} - -#define PCM_ERROR_MAX 128 - -struct pcm { - int fd; - unsigned int flags; - int running:1; - int prepared:1; - int underruns; - unsigned int buffer_size; - unsigned int boundary; - char error[PCM_ERROR_MAX]; - struct pcm_config config; - struct snd_pcm_mmap_status *mmap_status; - struct snd_pcm_mmap_control *mmap_control; - struct snd_pcm_sync_ptr *sync_ptr; - void *mmap_buffer; - unsigned int noirq_frames_per_msec; - int wait_for_avail_min; - unsigned int subdevice; -}; - -unsigned int pcm_get_buffer_size(struct pcm *pcm) -{ - return pcm->buffer_size; -} - -const char* pcm_get_error(struct pcm *pcm) -{ - return pcm->error; -} - -unsigned int pcm_get_subdevice(struct pcm *pcm) -{ - return pcm->subdevice; -} - -static int oops(struct pcm *pcm, int e, const char *fmt, ...) -{ - va_list ap; - int sz; - - va_start(ap, fmt); - vsnprintf(pcm->error, PCM_ERROR_MAX, fmt, ap); - va_end(ap); - sz = strlen(pcm->error); - - if (errno) - snprintf(pcm->error + sz, PCM_ERROR_MAX - sz, - ": %s", strerror(e)); - return -1; -} - -static unsigned int pcm_format_to_alsa(enum pcm_format format) -{ - switch (format) { - case PCM_FORMAT_S32_LE: - return SNDRV_PCM_FORMAT_S32_LE; - case PCM_FORMAT_S8: - return SNDRV_PCM_FORMAT_S8; - case PCM_FORMAT_S24_3LE: - return SNDRV_PCM_FORMAT_S24_3LE; - case PCM_FORMAT_S24_LE: - return SNDRV_PCM_FORMAT_S24_LE; - default: - case PCM_FORMAT_S16_LE: - return SNDRV_PCM_FORMAT_S16_LE; - }; -} - -unsigned int pcm_format_to_bits(enum pcm_format format) -{ - switch (format) { - case PCM_FORMAT_S32_LE: - case PCM_FORMAT_S24_LE: - return 32; - case PCM_FORMAT_S24_3LE: - return 24; - default: - case PCM_FORMAT_S16_LE: - return 16; - }; -} - -unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int bytes) -{ - return bytes / (pcm->config.channels * - (pcm_format_to_bits(pcm->config.format) >> 3)); -} - -unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames) -{ - return frames * pcm->config.channels * - (pcm_format_to_bits(pcm->config.format) >> 3); -} - -static int pcm_sync_ptr(struct pcm *pcm, int flags) { - if (pcm->sync_ptr) { - pcm->sync_ptr->flags = flags; - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_SYNC_PTR, pcm->sync_ptr) < 0) - return -1; - } - return 0; -} - -static int pcm_hw_mmap_status(struct pcm *pcm) { - - if (pcm->sync_ptr) - return 0; - - int page_size = sysconf(_SC_PAGE_SIZE); - pcm->mmap_status = mmap(NULL, page_size, PROT_READ, MAP_FILE | MAP_SHARED, - pcm->fd, SNDRV_PCM_MMAP_OFFSET_STATUS); - if (pcm->mmap_status == MAP_FAILED) - pcm->mmap_status = NULL; - if (!pcm->mmap_status) - goto mmap_error; - - pcm->mmap_control = mmap(NULL, page_size, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_SHARED, pcm->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL); - if (pcm->mmap_control == MAP_FAILED) - pcm->mmap_control = NULL; - if (!pcm->mmap_control) { - munmap(pcm->mmap_status, page_size); - pcm->mmap_status = NULL; - goto mmap_error; - } - if (pcm->flags & PCM_MMAP) - pcm->mmap_control->avail_min = pcm->config.avail_min; - else - pcm->mmap_control->avail_min = 1; - - return 0; - -mmap_error: - - pcm->sync_ptr = calloc(1, sizeof(*pcm->sync_ptr)); - if (!pcm->sync_ptr) - return -ENOMEM; - pcm->mmap_status = &pcm->sync_ptr->s.status; - pcm->mmap_control = &pcm->sync_ptr->c.control; - if (pcm->flags & PCM_MMAP) - pcm->mmap_control->avail_min = pcm->config.avail_min; - else - pcm->mmap_control->avail_min = 1; - - pcm_sync_ptr(pcm, 0); - - return 0; -} - -static void pcm_hw_munmap_status(struct pcm *pcm) { - if (pcm->sync_ptr) { - free(pcm->sync_ptr); - pcm->sync_ptr = NULL; - } else { - int page_size = sysconf(_SC_PAGE_SIZE); - if (pcm->mmap_status) - munmap(pcm->mmap_status, page_size); - if (pcm->mmap_control) - munmap(pcm->mmap_control, page_size); - } - pcm->mmap_status = NULL; - pcm->mmap_control = NULL; -} - -static int pcm_areas_copy(struct pcm *pcm, unsigned int pcm_offset, - char *buf, unsigned int src_offset, - unsigned int frames) -{ - int size_bytes = pcm_frames_to_bytes(pcm, frames); - int pcm_offset_bytes = pcm_frames_to_bytes(pcm, pcm_offset); - int src_offset_bytes = pcm_frames_to_bytes(pcm, src_offset); - - /* interleaved only atm */ - if (pcm->flags & PCM_IN) - memcpy(buf + src_offset_bytes, - (char*)pcm->mmap_buffer + pcm_offset_bytes, - size_bytes); - else - memcpy((char*)pcm->mmap_buffer + pcm_offset_bytes, - buf + src_offset_bytes, - size_bytes); - return 0; -} - -static int pcm_mmap_transfer_areas(struct pcm *pcm, char *buf, - unsigned int offset, unsigned int size) -{ - void *pcm_areas; - int commit; - unsigned int pcm_offset, frames, count = 0; - - while (size > 0) { - frames = size; - pcm_mmap_begin(pcm, &pcm_areas, &pcm_offset, &frames); - pcm_areas_copy(pcm, pcm_offset, buf, offset, frames); - commit = pcm_mmap_commit(pcm, pcm_offset, frames); - if (commit < 0) { - oops(pcm, commit, "failed to commit %d frames\n", frames); - return commit; - } - - offset += commit; - count += commit; - size -= commit; - } - return count; -} - -int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, - struct timespec *tstamp) -{ - int frames; - int rc; - snd_pcm_uframes_t hw_ptr; - - if (!pcm_is_ready(pcm)) - return -1; - - rc = pcm_sync_ptr(pcm, SNDRV_PCM_SYNC_PTR_APPL|SNDRV_PCM_SYNC_PTR_HWSYNC); - if (rc < 0) - return -1; - - if ((pcm->mmap_status->state != PCM_STATE_RUNNING) && - (pcm->mmap_status->state != PCM_STATE_DRAINING)) - return -1; - - *tstamp = pcm->mmap_status->tstamp; - if (tstamp->tv_sec == 0 && tstamp->tv_nsec == 0) - return -1; - - hw_ptr = pcm->mmap_status->hw_ptr; - if (pcm->flags & PCM_IN) - frames = hw_ptr - pcm->mmap_control->appl_ptr; - else - frames = hw_ptr + pcm->buffer_size - pcm->mmap_control->appl_ptr; - - if (frames < 0) - frames += pcm->boundary; - else if (frames > (int)pcm->boundary) - frames -= pcm->boundary; - - *avail = (unsigned int)frames; - - return 0; -} - -int pcm_write(struct pcm *pcm, const void *data, unsigned int count) -{ - struct snd_xferi x; - - if (pcm->flags & PCM_IN) - return -EINVAL; - - x.buf = (void*)data; - x.frames = count / (pcm->config.channels * - pcm_format_to_bits(pcm->config.format) / 8); - - for (;;) { - if (!pcm->running) { - int prepare_error = pcm_prepare(pcm); - if (prepare_error) - return prepare_error; - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x)) - return oops(pcm, errno, "cannot write initial data"); - pcm->running = 1; - return 0; - } - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x)) { - pcm->prepared = 0; - pcm->running = 0; - if (errno == EPIPE) { - /* we failed to make our window -- try to restart if we are - * allowed to do so. Otherwise, simply allow the EPIPE error to - * propagate up to the app level */ - pcm->underruns++; - if (pcm->flags & PCM_NORESTART) - return -EPIPE; - continue; - } - return oops(pcm, errno, "cannot write stream data"); - } - return 0; - } -} - -int pcm_read(struct pcm *pcm, void *data, unsigned int count) -{ - struct snd_xferi x; - - if (!(pcm->flags & PCM_IN)) - return -EINVAL; - - x.buf = data; - x.frames = count / (pcm->config.channels * - pcm_format_to_bits(pcm->config.format) / 8); - - for (;;) { - if (!pcm->running) { - if (pcm_start(pcm) < 0) { - fprintf(stderr, "start error"); - return -errno; - } - } - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) { - pcm->prepared = 0; - pcm->running = 0; - if (errno == EPIPE) { - /* we failed to make our window -- try to restart */ - pcm->underruns++; - continue; - } - return oops(pcm, errno, "cannot read stream data"); - } - return 0; - } -} - -static struct pcm bad_pcm = { - .fd = -1, -}; - -struct pcm_params *pcm_params_get(unsigned int card, unsigned int device, - unsigned int flags) -{ - struct snd_pcm_hw_params *params; - char fn[256]; - int fd; - - snprintf(fn, sizeof(fn), "/dev/snd/pcmC%uD%u%c", card, device, - flags & PCM_IN ? 'c' : 'p'); - - fd = open(fn, O_RDWR); - if (fd < 0) { - fprintf(stderr, "cannot open device '%s'\n", fn); - goto err_open; - } - - params = calloc(1, sizeof(struct snd_pcm_hw_params)); - if (!params) - goto err_calloc; - - param_init(params); - if (ioctl(fd, SNDRV_PCM_IOCTL_HW_REFINE, params)) { - fprintf(stderr, "SNDRV_PCM_IOCTL_HW_REFINE error (%d)\n", errno); - goto err_hw_refine; - } - - close(fd); - - return (struct pcm_params *)params; - -err_hw_refine: - free(params); -err_calloc: - close(fd); -err_open: - return NULL; -} - -void pcm_params_free(struct pcm_params *pcm_params) -{ - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - - if (params) - free(params); -} - -static int pcm_param_to_alsa(enum pcm_param param) -{ - switch (param) { - case PCM_PARAM_ACCESS: - return SNDRV_PCM_HW_PARAM_ACCESS; - case PCM_PARAM_FORMAT: - return SNDRV_PCM_HW_PARAM_FORMAT; - case PCM_PARAM_SUBFORMAT: - return SNDRV_PCM_HW_PARAM_SUBFORMAT; - case PCM_PARAM_SAMPLE_BITS: - return SNDRV_PCM_HW_PARAM_SAMPLE_BITS; - break; - case PCM_PARAM_FRAME_BITS: - return SNDRV_PCM_HW_PARAM_FRAME_BITS; - break; - case PCM_PARAM_CHANNELS: - return SNDRV_PCM_HW_PARAM_CHANNELS; - break; - case PCM_PARAM_RATE: - return SNDRV_PCM_HW_PARAM_RATE; - break; - case PCM_PARAM_PERIOD_TIME: - return SNDRV_PCM_HW_PARAM_PERIOD_TIME; - break; - case PCM_PARAM_PERIOD_SIZE: - return SNDRV_PCM_HW_PARAM_PERIOD_SIZE; - break; - case PCM_PARAM_PERIOD_BYTES: - return SNDRV_PCM_HW_PARAM_PERIOD_BYTES; - break; - case PCM_PARAM_PERIODS: - return SNDRV_PCM_HW_PARAM_PERIODS; - break; - case PCM_PARAM_BUFFER_TIME: - return SNDRV_PCM_HW_PARAM_BUFFER_TIME; - break; - case PCM_PARAM_BUFFER_SIZE: - return SNDRV_PCM_HW_PARAM_BUFFER_SIZE; - break; - case PCM_PARAM_BUFFER_BYTES: - return SNDRV_PCM_HW_PARAM_BUFFER_BYTES; - break; - case PCM_PARAM_TICK_TIME: - return SNDRV_PCM_HW_PARAM_TICK_TIME; - break; - - default: - return -1; - } -} - -struct pcm_mask *pcm_params_get_mask(struct pcm_params *pcm_params, - enum pcm_param param) -{ - int p; - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - if (params == NULL) { - return NULL; - } - - p = pcm_param_to_alsa(param); - if (p < 0 || !param_is_mask(p)) { - return NULL; - } - - return (struct pcm_mask *)param_to_mask(params, p); -} - -unsigned int pcm_params_get_min(struct pcm_params *pcm_params, - enum pcm_param param) -{ - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - int p; - - if (!params) - return 0; - - p = pcm_param_to_alsa(param); - if (p < 0) - return 0; - - return param_get_min(params, p); -} - -void pcm_params_set_min(struct pcm_params *pcm_params, - enum pcm_param param, unsigned int val) -{ - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - int p; - - if (!params) - return; - - p = pcm_param_to_alsa(param); - if (p < 0) - return; - - param_set_min(params, p, val); -} - -unsigned int pcm_params_get_max(struct pcm_params *pcm_params, - enum pcm_param param) -{ - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - int p; - - if (!params) - return 0; - - p = pcm_param_to_alsa(param); - if (p < 0) - return 0; - - return param_get_max(params, p); -} - -void pcm_params_set_max(struct pcm_params *pcm_params, - enum pcm_param param, unsigned int val) -{ - struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params; - int p; - - if (!params) - return; - - p = pcm_param_to_alsa(param); - if (p < 0) - return; - - param_set_max(params, p, val); -} - -static int pcm_mask_test(struct pcm_mask *m, unsigned int index) -{ - const unsigned int bitshift = 5; /* for 32 bit integer */ - const unsigned int bitmask = (1 << bitshift) - 1; - unsigned int element; - - element = index >> bitshift; - if (element >= ARRAY_SIZE(m->bits)) - return 0; /* for safety, but should never occur */ - return (m->bits[element] >> (index & bitmask)) & 1; -} - -static int pcm_mask_to_string(struct pcm_mask *m, char *string, unsigned int size, - char *mask_name, - const char * const *bit_array_name, size_t bit_array_size) -{ - unsigned int i; - unsigned int offset = 0; - - if (m == NULL) - return 0; - if (bit_array_size < 32) { - STRLOG(string, offset, size, "%12s:\t%#08x\n", mask_name, m->bits[0]); - } else { /* spans two or more bitfields, print with an array index */ - for (i = 0; i < (bit_array_size + 31) >> 5; ++i) { - STRLOG(string, offset, size, "%9s[%d]:\t%#08x\n", - mask_name, i, m->bits[i]); - } - } - for (i = 0; i < bit_array_size; ++i) { - if (pcm_mask_test(m, i)) { - STRLOG(string, offset, size, "%12s \t%s\n", "", bit_array_name[i]); - } - } - return offset; -} - -int pcm_params_to_string(struct pcm_params *params, char *string, unsigned int size) -{ - struct pcm_mask *m; - unsigned int min, max; - unsigned int clipoffset, offset; - - m = pcm_params_get_mask(params, PCM_PARAM_ACCESS); - offset = pcm_mask_to_string(m, string, size, - "Access", access_lookup, ARRAY_SIZE(access_lookup)); - m = pcm_params_get_mask(params, PCM_PARAM_FORMAT); - clipoffset = offset > size ? size : offset; - offset += pcm_mask_to_string(m, string + clipoffset, size - clipoffset, - "Format", format_lookup, ARRAY_SIZE(format_lookup)); - m = pcm_params_get_mask(params, PCM_PARAM_SUBFORMAT); - clipoffset = offset > size ? size : offset; - offset += pcm_mask_to_string(m, string + clipoffset, size - clipoffset, - "Subformat", subformat_lookup, ARRAY_SIZE(subformat_lookup)); - min = pcm_params_get_min(params, PCM_PARAM_RATE); - max = pcm_params_get_max(params, PCM_PARAM_RATE); - STRLOG(string, offset, size, " Rate:\tmin=%uHz\tmax=%uHz\n", min, max); - min = pcm_params_get_min(params, PCM_PARAM_CHANNELS); - max = pcm_params_get_max(params, PCM_PARAM_CHANNELS); - STRLOG(string, offset, size, " Channels:\tmin=%u\t\tmax=%u\n", min, max); - min = pcm_params_get_min(params, PCM_PARAM_SAMPLE_BITS); - max = pcm_params_get_max(params, PCM_PARAM_SAMPLE_BITS); - STRLOG(string, offset, size, " Sample bits:\tmin=%u\t\tmax=%u\n", min, max); - min = pcm_params_get_min(params, PCM_PARAM_PERIOD_SIZE); - max = pcm_params_get_max(params, PCM_PARAM_PERIOD_SIZE); - STRLOG(string, offset, size, " Period size:\tmin=%u\t\tmax=%u\n", min, max); - min = pcm_params_get_min(params, PCM_PARAM_PERIODS); - max = pcm_params_get_max(params, PCM_PARAM_PERIODS); - STRLOG(string, offset, size, "Period count:\tmin=%u\t\tmax=%u\n", min, max); - return offset; -} - -int pcm_params_format_test(struct pcm_params *params, enum pcm_format format) -{ - unsigned int alsa_format = pcm_format_to_alsa(format); - - if (alsa_format == SNDRV_PCM_FORMAT_S16_LE && format != PCM_FORMAT_S16_LE) - return 0; /* caution: format not recognized is equivalent to S16_LE */ - return pcm_mask_test(pcm_params_get_mask(params, PCM_PARAM_FORMAT), alsa_format); -} - -int pcm_close(struct pcm *pcm) -{ - if (pcm == &bad_pcm) - return 0; - - pcm_hw_munmap_status(pcm); - - if (pcm->flags & PCM_MMAP) { - pcm_stop(pcm); - munmap(pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); - } - - if (pcm->fd >= 0) - close(pcm->fd); - pcm->prepared = 0; - pcm->running = 0; - pcm->buffer_size = 0; - pcm->fd = -1; - free(pcm); - return 0; -} - -struct pcm *pcm_open(unsigned int card, unsigned int device, - unsigned int flags, struct pcm_config *config) -{ - struct pcm *pcm; - struct snd_pcm_info info; - struct snd_pcm_hw_params params; - struct snd_pcm_sw_params sparams; - char fn[256]; - int rc; - - pcm = calloc(1, sizeof(struct pcm)); - if (!pcm || !config) - return &bad_pcm; /* TODO: could support default config here */ - - pcm->config = *config; - - snprintf(fn, sizeof(fn), "/dev/snd/pcmC%uD%u%c", card, device, - flags & PCM_IN ? 'c' : 'p'); - - pcm->flags = flags; - pcm->fd = open(fn, O_RDWR|O_NONBLOCK); - if (pcm->fd < 0) { - oops(pcm, errno, "cannot open device '%s'", fn); - return pcm; - } - - if (fcntl(pcm->fd, F_SETFL, fcntl(pcm->fd, F_GETFL) & - ~O_NONBLOCK) < 0) { - oops(pcm, errno, "failed to reset blocking mode '%s'", fn); - goto fail_close; - } - - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_INFO, &info)) { - oops(pcm, errno, "cannot get info"); - goto fail_close; - } - pcm->subdevice = info.subdevice; - - param_init(¶ms); - param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_FORMAT, - pcm_format_to_alsa(config->format)); - param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_SUBFORMAT, - SNDRV_PCM_SUBFORMAT_STD); - param_set_min(¶ms, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, config->period_size); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, - pcm_format_to_bits(config->format)); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_FRAME_BITS, - pcm_format_to_bits(config->format) * config->channels); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_CHANNELS, - config->channels); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_PERIODS, config->period_count); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_RATE, config->rate); - - if (flags & PCM_NOIRQ) { - if (!(flags & PCM_MMAP)) { - oops(pcm, -EINVAL, "noirq only currently supported with mmap()."); - goto fail_close; - } - - params.flags |= SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP; - pcm->noirq_frames_per_msec = config->rate / 1000; - } - - if (flags & PCM_MMAP) - param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_ACCESS, - SNDRV_PCM_ACCESS_MMAP_INTERLEAVED); - else - param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_ACCESS, - SNDRV_PCM_ACCESS_RW_INTERLEAVED); - - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_HW_PARAMS, ¶ms)) { - oops(pcm, errno, "cannot set hw params"); - goto fail_close; - } - - /* get our refined hw_params */ - config->period_size = param_get_int(¶ms, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); - config->period_count = param_get_int(¶ms, SNDRV_PCM_HW_PARAM_PERIODS); - pcm->buffer_size = config->period_count * config->period_size; - - if (flags & PCM_MMAP) { - pcm->mmap_buffer = mmap(NULL, pcm_frames_to_bytes(pcm, pcm->buffer_size), - PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, pcm->fd, 0); - if (pcm->mmap_buffer == MAP_FAILED) { - oops(pcm, -errno, "failed to mmap buffer %d bytes\n", - pcm_frames_to_bytes(pcm, pcm->buffer_size)); - goto fail_close; - } - } - - memset(&sparams, 0, sizeof(sparams)); - sparams.tstamp_mode = SNDRV_PCM_TSTAMP_ENABLE; - sparams.period_step = 1; - - if (!config->start_threshold) { - if (pcm->flags & PCM_IN) - pcm->config.start_threshold = sparams.start_threshold = 1; - else - pcm->config.start_threshold = sparams.start_threshold = - config->period_count * config->period_size / 2; - } else - sparams.start_threshold = config->start_threshold; - - /* pick a high stop threshold - todo: does this need further tuning */ - if (!config->stop_threshold) { - if (pcm->flags & PCM_IN) - pcm->config.stop_threshold = sparams.stop_threshold = - config->period_count * config->period_size * 10; - else - pcm->config.stop_threshold = sparams.stop_threshold = - config->period_count * config->period_size; - } - else - sparams.stop_threshold = config->stop_threshold; - - if (!pcm->config.avail_min) { - if (pcm->flags & PCM_MMAP) - pcm->config.avail_min = sparams.avail_min = pcm->config.period_size; - else - pcm->config.avail_min = sparams.avail_min = 1; - } else - sparams.avail_min = config->avail_min; - - sparams.xfer_align = config->period_size / 2; /* needed for old kernels */ - sparams.silence_threshold = config->silence_threshold; - sparams.silence_size = config->silence_size; - pcm->boundary = sparams.boundary = pcm->buffer_size; - - while (pcm->boundary * 2 <= INT_MAX - pcm->buffer_size) - pcm->boundary *= 2; - - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_SW_PARAMS, &sparams)) { - oops(pcm, errno, "cannot set sw params"); - goto fail; - } - - rc = pcm_hw_mmap_status(pcm); - if (rc < 0) { - oops(pcm, rc, "mmap status failed"); - goto fail; - } - -#ifdef SNDRV_PCM_IOCTL_TTSTAMP - if (pcm->flags & PCM_MONOTONIC) { - int arg = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC; - rc = ioctl(pcm->fd, SNDRV_PCM_IOCTL_TTSTAMP, &arg); - if (rc < 0) { - oops(pcm, rc, "cannot set timestamp type"); - goto fail; - } - } -#endif - - pcm->underruns = 0; - return pcm; - -fail: - if (flags & PCM_MMAP) - munmap(pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); -fail_close: - close(pcm->fd); - pcm->fd = -1; - return pcm; -} - -int pcm_is_ready(struct pcm *pcm) -{ - return pcm->fd >= 0; -} - -int pcm_prepare(struct pcm *pcm) -{ - if (pcm->prepared) - return 0; - - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_PREPARE) < 0) - return oops(pcm, errno, "cannot prepare channel"); - - pcm->prepared = 1; - return 0; -} - -int pcm_start(struct pcm *pcm) -{ - int prepare_error = pcm_prepare(pcm); - if (prepare_error) - return prepare_error; - - if (pcm->flags & PCM_MMAP) - pcm_sync_ptr(pcm, 0); - - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_START) < 0) - return oops(pcm, errno, "cannot start channel"); - - pcm->running = 1; - return 0; -} - -int pcm_stop(struct pcm *pcm) -{ - if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_DROP) < 0) - return oops(pcm, errno, "cannot stop channel"); - - pcm->prepared = 0; - pcm->running = 0; - return 0; -} - -static inline int pcm_mmap_playback_avail(struct pcm *pcm) -{ - int avail; - - avail = pcm->mmap_status->hw_ptr + pcm->buffer_size - pcm->mmap_control->appl_ptr; - - if (avail < 0) - avail += pcm->boundary; - else if (avail > (int)pcm->boundary) - avail -= pcm->boundary; - - return avail; -} - -static inline int pcm_mmap_capture_avail(struct pcm *pcm) -{ - int avail = pcm->mmap_status->hw_ptr - pcm->mmap_control->appl_ptr; - if (avail < 0) - avail += pcm->boundary; - return avail; -} - -int pcm_mmap_avail(struct pcm *pcm) -{ - pcm_sync_ptr(pcm, SNDRV_PCM_SYNC_PTR_HWSYNC); - if (pcm->flags & PCM_IN) - return pcm_mmap_capture_avail(pcm); - else - return pcm_mmap_playback_avail(pcm); -} - -static void pcm_mmap_appl_forward(struct pcm *pcm, int frames) -{ - unsigned int appl_ptr = pcm->mmap_control->appl_ptr; - appl_ptr += frames; - - /* check for boundary wrap */ - if (appl_ptr > pcm->boundary) - appl_ptr -= pcm->boundary; - pcm->mmap_control->appl_ptr = appl_ptr; -} - -int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, - unsigned int *frames) -{ - unsigned int continuous, copy_frames, avail; - - /* return the mmap buffer */ - *areas = pcm->mmap_buffer; - - /* and the application offset in frames */ - *offset = pcm->mmap_control->appl_ptr % pcm->buffer_size; - - avail = pcm_mmap_avail(pcm); - if (avail > pcm->buffer_size) - avail = pcm->buffer_size; - continuous = pcm->buffer_size - *offset; - - /* we can only copy frames if the are availabale and continuos */ - copy_frames = *frames; - if (copy_frames > avail) - copy_frames = avail; - if (copy_frames > continuous) - copy_frames = continuous; - *frames = copy_frames; - - return 0; -} - -int pcm_mmap_commit(struct pcm *pcm, unsigned int offset __attribute__((unused)), unsigned int frames) -{ - /* update the application pointer in userspace and kernel */ - pcm_mmap_appl_forward(pcm, frames); - pcm_sync_ptr(pcm, 0); - - return frames; -} - -int pcm_avail_update(struct pcm *pcm) -{ - pcm_sync_ptr(pcm, 0); - return pcm_mmap_avail(pcm); -} - -int pcm_state(struct pcm *pcm) -{ - int err = pcm_sync_ptr(pcm, 0); - if (err < 0) - return err; - - return pcm->mmap_status->state; -} - -int pcm_set_avail_min(struct pcm *pcm, int avail_min) -{ - if ((~pcm->flags) & (PCM_MMAP | PCM_NOIRQ)) - return -ENOSYS; - - pcm->config.avail_min = avail_min; - return 0; -} - -int pcm_wait(struct pcm *pcm, int timeout) -{ - struct pollfd pfd; - int err; - - pfd.fd = pcm->fd; - pfd.events = POLLOUT | POLLERR | POLLNVAL; - - do { - /* let's wait for avail or timeout */ - err = poll(&pfd, 1, timeout); - if (err < 0) - return -errno; - - /* timeout ? */ - if (err == 0) - return 0; - - /* have we been interrupted ? */ - if (errno == -EINTR) - continue; - - /* check for any errors */ - if (pfd.revents & (POLLERR | POLLNVAL)) { - switch (pcm_state(pcm)) { - case PCM_STATE_XRUN: - return -EPIPE; - case PCM_STATE_SUSPENDED: - return -ESTRPIPE; - case PCM_STATE_DISCONNECTED: - return -ENODEV; - default: - return -EIO; - } - } - /* poll again if fd not ready for IO */ - } while (!(pfd.revents & (POLLIN | POLLOUT))); - - return 1; -} - -int pcm_get_poll_fd(struct pcm *pcm) -{ - return pcm->fd; -} - -int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int bytes) -{ - int err = 0, frames, avail; - unsigned int offset = 0, count; - - if (bytes == 0) - return 0; - - count = pcm_bytes_to_frames(pcm, bytes); - - while (count > 0) { - - /* get the available space for writing new frames */ - avail = pcm_avail_update(pcm); - if (avail < 0) { - fprintf(stderr, "cannot determine available mmap frames"); - return err; - } - - /* start the audio if we reach the threshold */ - if (!pcm->running && - (pcm->buffer_size - avail) >= pcm->config.start_threshold) { - if (pcm_start(pcm) < 0) { - fprintf(stderr, "start error: hw 0x%x app 0x%x avail 0x%x\n", - (unsigned int)pcm->mmap_status->hw_ptr, - (unsigned int)pcm->mmap_control->appl_ptr, - avail); - return -errno; - } - pcm->wait_for_avail_min = 0; - } - - /* sleep until we have space to write new frames */ - if (pcm->running) { - /* enable waiting for avail_min threshold when less frames than we have to write - * are available. */ - if (!pcm->wait_for_avail_min && (count > (unsigned int)avail)) - pcm->wait_for_avail_min = 1; - - if (pcm->wait_for_avail_min && (avail < pcm->config.avail_min)) { - int time = -1; - - /* disable waiting for avail_min threshold to allow small amounts of data to be - * written without waiting as long as there is enough room in buffer. */ - pcm->wait_for_avail_min = 0; - - if (pcm->flags & PCM_NOIRQ) - time = (pcm->config.avail_min - avail) / pcm->noirq_frames_per_msec; - - err = pcm_wait(pcm, time); - if (err < 0) { - pcm->prepared = 0; - pcm->running = 0; - oops(pcm, err, "wait error: hw 0x%x app 0x%x avail 0x%x\n", - (unsigned int)pcm->mmap_status->hw_ptr, - (unsigned int)pcm->mmap_control->appl_ptr, - avail); - pcm->mmap_control->appl_ptr = 0; - return err; - } - continue; - } - } - - frames = count; - if (frames > avail) - frames = avail; - - if (!frames) - break; - - /* copy frames from buffer */ - frames = pcm_mmap_transfer_areas(pcm, (void *)buffer, offset, frames); - if (frames < 0) { - fprintf(stderr, "write error: hw 0x%x app 0x%x avail 0x%x\n", - (unsigned int)pcm->mmap_status->hw_ptr, - (unsigned int)pcm->mmap_control->appl_ptr, - avail); - return frames; - } - - offset += frames; - count -= frames; - } - - return 0; -} - -int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count) -{ - if ((~pcm->flags) & (PCM_OUT | PCM_MMAP)) - return -ENOSYS; - - return pcm_mmap_transfer(pcm, (void *)data, count); -} - -int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) -{ - if ((~pcm->flags) & (PCM_IN | PCM_MMAP)) - return -ENOSYS; - - return pcm_mmap_transfer(pcm, data, count); -} - -int pcm_ioctl(struct pcm *pcm, int request, ...) -{ - va_list ap; - void * arg; - - if (!pcm_is_ready(pcm)) - return -1; - - va_start(ap, request); - arg = va_arg(ap, void *); - va_end(ap); - - return ioctl(pcm->fd, request, arg); -} diff --git a/hifi/xaf/host-apf/playback/xa_playback.c b/hifi/xaf/host-apf/playback/xa_playback.c deleted file mode 100644 index 2a8eefdf..00000000 --- a/hifi/xaf/host-apf/playback/xa_playback.c +++ /dev/null @@ -1,366 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MODULE_TAG PLYBK - -#include <tinyalsa/asoundlib.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdint.h> -#include <string.h> -#include <signal.h> -#include <sys/ioctl.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> - -#include "xf.h" -#include "xa_playback.h" - -#if 0 -#define ID_RIFF 0x46464952 -#define ID_WAVE 0x45564157 -#define ID_FMT 0x20746d66 -#define ID_DATA 0x61746164 - -#define HIFI_MISC_IOCTL_PCM_GAIN _IOW('A', 0x7b, struct misc_io_pcm_buf_param) -#define HIFI_DSP_MISC_DRIVER "/dev/hifi_misc" -struct misc_io_pcm_buf_param { - uint64_t buf; - uint32_t buf_size; -}; - -struct riff_wave_header { - uint32_t riff_id; - uint32_t riff_sz; - uint32_t wave_id; -}; - -struct chunk_header { - uint32_t id; - uint32_t sz; -}; - -struct chunk_fmt { - uint16_t audio_format; - uint16_t num_channels; - uint32_t sample_rate; - uint32_t byte_rate; - uint16_t block_align; - uint16_t bits_per_sample; -}; - -static int s_close = 0; - -void play_sample(FILE *file, unsigned int card, unsigned int device, unsigned int channels, - unsigned int rate, unsigned int bits, unsigned int period_size, - unsigned int period_count); - -void stream_close(int sig) -{ - /* allow the stream to be closed gracefully */ - signal(sig, SIG_IGN); - s_close = 1; -} -#endif - -#if 0 -int main(int argc, char **argv) -{ - FILE *file; - struct riff_wave_header riff_wave_header; - struct chunk_header chunk_header; - struct chunk_fmt chunk_fmt; - unsigned int device = 0; - unsigned int card = 0; - unsigned int period_size = 1024; - unsigned int period_count = 4; - char *filename; - int more_chunks = 1; - - if (argc < 2) { - fprintf(stderr, "Usage: %s file.wav [-D card] [-d device] [-p period_size]" - " [-n n_periods] \n", argv[0]); - return 1; - } - - filename = argv[1]; - file = fopen(filename, "rb"); - if (!file) { - fprintf(stderr, "Unable to open file '%s'\n", filename); - return 1; - } - - fread(&riff_wave_header, sizeof(riff_wave_header), 1, file); - if ((riff_wave_header.riff_id != ID_RIFF) || - (riff_wave_header.wave_id != ID_WAVE)) { - fprintf(stderr, "Error: '%s' is not a riff/wave file\n", filename); - fclose(file); - return 1; - } - - do { - fread(&chunk_header, sizeof(chunk_header), 1, file); - - switch (chunk_header.id) { - case ID_FMT: - fread(&chunk_fmt, sizeof(chunk_fmt), 1, file); - /* If the format header is larger, skip the rest */ - if (chunk_header.sz > sizeof(chunk_fmt)) - fseek(file, chunk_header.sz - sizeof(chunk_fmt), SEEK_CUR); - break; - case ID_DATA: - /* Stop looking for chunks */ - more_chunks = 0; - break; - default: - /* Unknown chunk, skip bytes */ - fseek(file, chunk_header.sz, SEEK_CUR); - } - } while (more_chunks); - - /* parse command line arguments */ - argv += 2; - while (*argv) { - if (strcmp(*argv, "-d") == 0) { - argv++; - if (*argv) - device = atoi(*argv); - } - if (strcmp(*argv, "-p") == 0) { - argv++; - if (*argv) - period_size = atoi(*argv); - } - if (strcmp(*argv, "-n") == 0) { - argv++; - if (*argv) - period_count = atoi(*argv); - } - if (strcmp(*argv, "-D") == 0) { - argv++; - if (*argv) - card = atoi(*argv); - } - if (*argv) - argv++; - } - - play_sample(file, card, device, chunk_fmt.num_channels, chunk_fmt.sample_rate, - chunk_fmt.bits_per_sample, period_size, period_count); - - fclose(file); - - return 0; -} -#endif - -static int check_param(struct pcm_params *params, unsigned int param, unsigned int value, - char *param_name, char *param_unit) -{ - unsigned int min; - unsigned int max; - int is_within_bounds = 1; - - min = pcm_params_get_min(params, param); - if (value < min) { - TRACE(ERROR, _x("%s is %u%s, device only supports >= %u%s\n"), param_name, value, - param_unit, min, param_unit); - is_within_bounds = 0; - } - - max = pcm_params_get_max(params, param); - if (value > max) { - TRACE(ERROR, _x("%s is %u%s, device only supports <= %u%s\n"), param_name, value, - param_unit, max, param_unit); - is_within_bounds = 0; - } - - return is_within_bounds; -} - -static int sample_is_playable(unsigned int card, unsigned int device, unsigned int channels, - unsigned int rate, unsigned int bits, unsigned int period_size, - unsigned int period_count) -{ - struct pcm_params *params; - int can_play; - - params = pcm_params_get(card, device, PCM_OUT); - if (params == NULL) { - TRACE(ERROR, _x("Unable to open PCM device %u.\n"), device); - return 0; - } - - can_play = check_param(params, PCM_PARAM_RATE, rate, "Sample rate", "Hz"); - can_play &= check_param(params, PCM_PARAM_CHANNELS, channels, "Sample", " channels"); - can_play &= check_param(params, PCM_PARAM_SAMPLE_BITS, bits, "Bitrate", " bits"); - can_play &= check_param(params, PCM_PARAM_PERIOD_SIZE, period_size, "Period size", "Hz"); - can_play &= check_param(params, PCM_PARAM_PERIODS, period_count, "Period count", "Hz"); - - pcm_params_free(params); - - return can_play; -} - -void *xa_playback_open(unsigned int card, - unsigned int device, - unsigned int channels, - unsigned int rate, - unsigned int bits, - unsigned int period_size, - unsigned int period_count) -{ - struct pcm_config config; - struct pcm *pcm; - - memset(&config, 0, sizeof(config)); - config.channels = channels; - config.rate = rate; - config.period_size = period_size; - config.period_count = period_count; - if (bits == 32) - config.format = PCM_FORMAT_S32_LE; - else if (bits == 16) - config.format = PCM_FORMAT_S16_LE; - config.start_threshold = 0; - config.stop_threshold = 0; - config.silence_threshold = 0; - - if (!sample_is_playable(card, device, channels, rate, bits, period_size, period_count)) { - return NULL; - } - - pcm = pcm_open(card, device, PCM_OUT, &config); - if (!pcm || !pcm_is_ready(pcm)) { - TRACE(ERROR, _x("Unable to open PCM device %u (%s)\n"), - device, pcm_get_error(pcm)); - return NULL; - } - - return pcm; -} - -int xa_playback_buf(void *handle, - const void *data, - unsigned int nbytes) -{ - int err; - - if (!handle || !data) - return XA_PLAYBACK_INVALID_PARAM; - - if (nbytes > 0) { - err = pcm_write(handle, data, nbytes); - - if (err == -EINVAL) return XA_PLAYBACK_INVALID_PARAM; - if (err == -EPIPE ) return XA_PLAYBACK_UNDERRUN; - } - - return XA_PLAYBACK_OK; -} - -int xa_playback_close(void *handle) -{ - return pcm_close(handle); -} - -#if 0 -void play_sample(FILE *file, unsigned int card, unsigned int device, unsigned int channels, - unsigned int rate, unsigned int bits, unsigned int period_size, - unsigned int period_count) -{ - struct pcm_config config; - struct pcm *pcm; - char *buffer; - int size; - int num_read; - int hifi_dsp_fd; - struct misc_io_pcm_buf_param pcmbuf; - - hifi_dsp_fd = open(HIFI_DSP_MISC_DRIVER, O_RDWR, 0); - if(hifi_dsp_fd < 0){ - printf("Error opening hifi dsp device %d", errno); - } - - memset(&config, 0, sizeof(config)); - config.channels = channels; - config.rate = rate; - config.period_size = period_size; - config.period_count = period_count; - if (bits == 32) - config.format = PCM_FORMAT_S32_LE; - else if (bits == 16) - config.format = PCM_FORMAT_S16_LE; - config.start_threshold = 0; - config.stop_threshold = 0; - config.silence_threshold = 0; - - if (!sample_is_playable(card, device, channels, rate, bits, period_size, period_count)) { - return; - } - - pcm = pcm_open(card, device, PCM_OUT, &config); - if (!pcm || !pcm_is_ready(pcm)) { - fprintf(stderr, "Unable to open PCM device %u (%s)\n", - device, pcm_get_error(pcm)); - return; - } - - size = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm)); - buffer = malloc(size); - if (!buffer) { - fprintf(stderr, "Unable to allocate %d bytes\n", size); - free(buffer); - pcm_close(pcm); - return; - } - - printf("Playing sample: %u ch, %u hz, %u bit\n", channels, rate, bits); - - /* catch ctrl-c to shutdown cleanly */ - signal(SIGINT, stream_close); - - do { - num_read = fread(buffer, 1, size, file); - - pcmbuf.buf =(uint64_t) buffer; - pcmbuf.buf_size = num_read; - if(hifi_dsp_fd) { - // printf("ioctl send \n"); - ioctl(hifi_dsp_fd,HIFI_MISC_IOCTL_PCM_GAIN, &pcmbuf); - // printf("ioctl complete \n"); - } - - if (num_read > 0) { - if (pcm_write(pcm, buffer, num_read)) { - fprintf(stderr, "Error playing sample\n"); - break; - } - } - } while (!s_close && num_read > 0); - - free(buffer); - pcm_close(pcm); - close(hifi_dsp_fd); -} -#endif diff --git a/hifi/xaf/host-apf/playback/xa_playback.h b/hifi/xaf/host-apf/playback/xa_playback.h deleted file mode 100644 index 8e4b3c63..00000000 --- a/hifi/xaf/host-apf/playback/xa_playback.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -enum xa_playback_error { - XA_PLAYBACK_OK = 0, - XA_PLAYBACK_INVALID_PARAM = -1, - XA_PLAYBACK_UNDERRUN = -2, -}; - -void *xa_playback_open(unsigned int card, - unsigned int device, - unsigned int channels, - unsigned int rate, - unsigned int bits, - unsigned int period_size, - unsigned int period_count); - -int xa_playback_buf(void *handle, - const void *data, - unsigned int nbytes); - -int xa_playback_close(void *handle); - diff --git a/hifi/xaf/host-apf/proxy/xaf-api.c b/hifi/xaf/host-apf/proxy/xaf-api.c deleted file mode 100644 index 6b5862df..00000000 --- a/hifi/xaf/host-apf/proxy/xaf-api.c +++ /dev/null @@ -1,597 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -#include "xf.h" -#include "xaf-api.h" -#include "xaf-structs.h" - -#ifdef XAF_HOSTLESS -#include "xos-msgq-if.h" -#endif -#define MODULE_TAG DEVAPI - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(DEBUG, 1); -TRACE_TAG(INFO, 1); - -#define XAF_4BYTE_ALIGN 4 -#define XAF_8BYTE_ALIGN 8 -#define XAF_32BYTE_ALIGN 32 - - -static void xaf_comp_response(xf_handle_t *h, xf_user_msg_t *msg) -{ - if (msg->opcode == XF_UNREGISTER) - { - /* ...component execution failed unexpectedly; die */ - BUG(1, _x("[%p] Abnormal termination"), h); - } - else - { - /* ...submit response to asynchronous delivery queue */ - xf_response_put(h, msg); - } -} - -static XAF_ERR_CODE xaf_comp_add(xaf_comp_t **pp_comp_chain, xaf_comp_t *p_comp) -{ - XAF_CHK_PTR(pp_comp_chain); - XAF_CHK_PTR(p_comp); - - p_comp->next = *pp_comp_chain; - *pp_comp_chain = p_comp; - - return XAF_NO_ERROR; -} - -static XAF_ERR_CODE xaf_comp_post_init_config(xaf_adev_t *p_adev, xaf_comp_t *p_comp, void *p_msg) -{ - xf_proxy_t *p_proxy = &p_adev->proxy; - xf_start_msg_t *smsg = p_msg; - - p_comp->out_format.sample_rate = smsg->sample_rate; - p_comp->out_format.channels = smsg->channels; - p_comp->out_format.pcm_width = smsg->pcm_width; - p_comp->out_format.input_length = smsg->input_length; - p_comp->out_format.output_length = smsg->output_length; - - TRACE(INFO, _b("Component[%x] Params: f=%d, c=%d, w=%d i=%d o=%d"), p_comp->handle.id, smsg->sample_rate, smsg->channels, smsg->pcm_width, smsg->input_length, smsg->output_length); - - if (p_comp->noutbuf) - { - XF_CHK_API(xf_pool_alloc(p_proxy, p_comp->noutbuf, smsg->output_length, XF_POOL_OUTPUT, &p_comp->outpool, XAF_MEM_ID_COMP, - p_adev->pxf_mem_malloc_fxn, p_adev->pxf_mem_free_fxn)); - } - - p_comp->init_done = 1; - p_comp->comp_status = XAF_INIT_DONE; - - return XAF_NO_ERROR; -} - -#ifdef XAF_HOSTLESS -XAF_ERR_CODE xaf_xos_start() -{ -#if defined BOARD - xos_set_clock_freq(xtbsp_clock_freq_hz()); -#else - xos_set_clock_freq(XOS_CLOCK_FREQ); -#endif - - xos_start("main", 7, 0); -#if XCHAL_NUM_TIMERS > 0 - xos_start_system_timer(0, TICK_CYCLES); -#endif - - return XAF_NO_ERROR; -} -#endif - -XAF_ERR_CODE xaf_adev_open(void** pp_adev, s32 audio_frmwk_buf_size, s32 audio_comp_buf_size, xaf_mem_malloc_fxn_t mem_malloc, xaf_mem_free_fxn_t mem_free) -{ - int size; - void * pTmp; - xaf_adev_t *p_adev; - xf_proxy_t *p_proxy; - - XAF_CHK_PTR(pp_adev); - XAF_CHK_PTR(mem_malloc); - XAF_CHK_PTR(mem_free); - - /* ...unused arg */ - (void) audio_comp_buf_size; - - //Memory allocation for adev struct pointer - size = (sizeof(xaf_adev_t) +(XAF_4BYTE_ALIGN-1)); - pTmp = mem_malloc(size, XAF_MEM_ID_DEV); - XAF_CHK_PTR(pTmp); - memset(pTmp, 0, size); - - p_adev = (xaf_adev_t *) (((unsigned long)pTmp + (XAF_4BYTE_ALIGN-1))& ~(XAF_4BYTE_ALIGN-1)); - p_adev->adev_ptr = pTmp; - *pp_adev = (void *)p_adev; - - p_proxy = &p_adev->proxy; - - // Host side Memory allocation (BSS) - p_adev->pxf_mem_malloc_fxn = mem_malloc; - p_adev->pxf_mem_free_fxn = mem_free; - - size = sizeof(xaf_ap_utils_t)+(XAF_8BYTE_ALIGN-1); - p_adev->p_ap_utils = mem_malloc(size, XAF_MEM_ID_DEV); - XAF_CHK_PTR(p_adev->p_ap_utils); - //reset memory size stats - memset(p_adev->p_ap_utils, 0, sizeof(xaf_ap_utils_t)); - - // shmmem Memory allocation - p_adev->p_ap_utils->xf_cfg_remote_ipc_pool_size = audio_frmwk_buf_size; //minimum size 256 KB, mmap multiple is 0x1000 - - //DSP localbuf allocation is done in the DSP core; nothing to be done here - - /* ...open DSP proxy - specify "DSP#0" */ - XF_CHK_API(xf_proxy_init(p_proxy, 0, (void *)&p_adev->p_ap_utils->xf_cfg_remote_ipc_pool_size)); - - /* ...create auxiliary buffers pool for control commands */ - XF_CHK_API(xf_pool_alloc(p_proxy, XAF_AUX_POOL_SIZE, XAF_AUX_POOL_MSG_LENGTH, XF_POOL_AUX, &p_proxy->aux, XAF_MEM_ID_DEV, - p_adev->pxf_mem_malloc_fxn, p_adev->pxf_mem_free_fxn)); - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_adev_close(void* adev_ptr, xaf_comp_flag flag) -{ - xaf_adev_t *p_adev; - xf_proxy_t *p_proxy; - - XAF_CHK_PTR(adev_ptr); - p_adev = (xaf_adev_t *)adev_ptr; - - /* ...unused arg */ - (void) flag; - - p_proxy = &p_adev->proxy; - if(p_proxy->aux != NULL) - { - xf_pool_free(p_proxy->aux, XAF_MEM_ID_DEV, p_adev->pxf_mem_free_fxn); - } - - xf_proxy_close(p_proxy); - - p_adev->pxf_mem_free_fxn(p_adev->p_ap_utils, XAF_MEM_ID_DEV); - p_adev->p_ap_utils = NULL; - p_adev->pxf_mem_free_fxn(p_adev->adev_ptr, XAF_MEM_ID_DEV); - p_adev->adev_ptr = NULL; - - p_adev->pxf_mem_malloc_fxn = NULL; - p_adev->pxf_mem_free_fxn = NULL; - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_comp_create(void *adev_ptr, void **pp_comp, xf_id_t comp_id, u32 ninbuf, u32 noutbuf, void *pp_inbuf[], xaf_comp_type comp_type) -{ - xf_handle_t *p_handle; - void * pTmp; - int size; - - xaf_adev_t *p_adev; - p_adev = (xaf_adev_t *)adev_ptr; - xaf_comp_t *p_comp; - - XAF_CHK_PTR(p_adev); - XAF_CHK_PTR(pp_comp); - XAF_CHK_PTR(comp_id); - if (ninbuf) XAF_CHK_PTR(pp_inbuf); - - XAF_CHK_RANGE(ninbuf, 0, XAF_MAX_INBUFS); - XAF_CHK_RANGE(noutbuf, 0, 1); - XAF_CHK_RANGE(comp_type, XAF_DECODER, XAF_POST_PROC); - - //Memory allocation for component struct pointer - size = (sizeof(xaf_comp_t) + (XAF_4BYTE_ALIGN-1)); - pTmp = p_adev->pxf_mem_malloc_fxn(size, XAF_MEM_ID_COMP); - XAF_CHK_PTR(pTmp); - memset(pTmp, 0, size); - p_comp = (xaf_comp_t *) (((unsigned long)pTmp + (XAF_4BYTE_ALIGN-1))& ~(XAF_4BYTE_ALIGN-1)); - - p_comp->comp_ptr = pTmp; - *pp_comp = (void*)p_comp; - - memset(p_comp, 0, sizeof(xaf_comp_t)); - p_handle = &p_comp->handle; - - /* ...create component instance (select core-0) */ - XF_CHK_API(xf_open(&p_adev->proxy, p_handle, comp_id, 0, xaf_comp_response)); - - xaf_comp_add(&p_adev->comp_chain, p_comp); - - // Temporary solution in place of component chain handling - p_comp->p_adev = p_adev; - p_adev->n_comp += 1; - p_comp->ninbuf = ninbuf; - - /* ...allocate input buffer */ - if (ninbuf) - { - xf_buffer_t *buf; - u32 i; - XF_CHK_API(xf_pool_alloc(&p_adev->proxy, ninbuf, XAF_INBUF_SIZE, XF_POOL_INPUT, &p_comp->inpool, XAF_MEM_ID_COMP, - p_adev->pxf_mem_malloc_fxn, p_adev->pxf_mem_free_fxn)); - - for (i=0; i<ninbuf; i++) - { - buf = xf_buffer_get(p_comp->inpool); - pp_inbuf[i] = xf_buffer_data(buf); - } - - } - p_comp->noutbuf = noutbuf; - - p_comp->comp_type = comp_type; - p_comp->comp_status = XAF_STARTING; - - switch (comp_type) - { - case XAF_DECODER: - case XAF_ENCODER: - case XAF_PRE_PROC: - case XAF_POST_PROC: - p_comp->inp_ports = 1; p_comp->out_ports = 1; - break; - case XAF_MIXER: - p_comp->inp_ports = 4; p_comp->out_ports = 1; - break; - } - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_comp_delete(void *comp_ptr) -{ - xaf_adev_t *p_adev; - - xaf_comp_t *p_comp; - p_comp = (xaf_comp_t *)comp_ptr; - - XAF_CHK_PTR(p_comp); - - // Temporary solution in place of component chain handling - p_adev = (xaf_adev_t *)(p_comp->p_adev); - XF_CHK_ERR((p_adev->n_comp > 0), XAF_API_ERR); - p_adev->n_comp -= 1; - - - if (p_comp->inpool) xf_pool_free(p_comp->inpool, XAF_MEM_ID_COMP, p_adev->pxf_mem_free_fxn); - if (p_comp->outpool) xf_pool_free(p_comp->outpool, XAF_MEM_ID_COMP, p_adev->pxf_mem_free_fxn); - - xf_close(&p_comp->handle); - - /* ...tbd - remove from chain */ - p_adev->pxf_mem_free_fxn(p_comp->comp_ptr, XAF_MEM_ID_COMP); - p_comp->comp_ptr = NULL; - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_comp_set_config(void *comp_ptr, s32 num_param, s32 *p_param) -{ - xaf_comp_t *p_comp; - xf_user_msg_t rmsg; - xf_set_param_msg_t *smsg; - xf_handle_t *p_handle; - s32 i, j; - - p_comp = (xaf_comp_t *)comp_ptr; - - XAF_CHK_PTR(p_comp); - XAF_CHK_PTR(p_param); - XAF_CHK_RANGE(num_param, 1, XAF_MAX_CONFIG_PARAMS); - - p_handle = &p_comp->handle; - XAF_CHK_PTR(p_handle); - - /* ...set persistent stream characteristics */ - smsg = xf_buffer_data(p_handle->aux); - - j = 0; - for (i=0; i<num_param; i++) - { - smsg->item[i].id = p_param[j++]; - smsg->item[i].value = p_param[j++]; - } - - /* ...pass command to the component */ - /* ...tbd - command goes port 0 always, check if okay */ - XF_CHK_API(xf_command(p_handle, 0, XF_SET_PARAM, smsg, sizeof(xf_set_param_item_t)*num_param)); - - /* ...wait until result is delivered */ - XF_CHK_API(xf_response_get(p_handle, &rmsg)); - - /* ...make sure response is expected */ - XF_CHK_ERR(rmsg.opcode == (u32) XF_SET_PARAM && rmsg.buffer == smsg, XAF_API_ERR); - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_comp_get_config(void *comp_ptr, s32 num_param, s32 *p_param) -{ - xaf_comp_t *p_comp; - xf_user_msg_t rmsg; - xf_get_param_msg_t *smsg; - xf_handle_t *p_handle; - s32 i; - - p_comp = (xaf_comp_t *)comp_ptr; - - XAF_CHK_PTR(p_comp); - XAF_CHK_PTR(p_param); - XAF_CHK_RANGE(num_param, 1, XAF_MAX_CONFIG_PARAMS); - - p_handle = &p_comp->handle; - XAF_CHK_PTR(p_handle); - - /* ...set persistent stream characteristics */ - smsg = xf_buffer_data(p_handle->aux); - - for (i=0; i<num_param; i++) - { - smsg->c.id[i] = p_param[i]; - } - - /* ...pass command to the component */ - /* ...tbd - command goes port 0 always, check if okay */ - XF_CHK_API(xf_command(p_handle, 0, XF_GET_PARAM, smsg, XF_GET_PARAM_CMD_LEN(num_param))); - - /* ...wait until result is delivered */ - XF_CHK_API(xf_response_get(p_handle, &rmsg)); - - /* ...make sure response is expected */ - XF_CHK_ERR(rmsg.opcode == (u32) XF_GET_PARAM && rmsg.buffer == smsg, XAF_API_ERR); - - for (i=0; i<num_param; i++) - { - p_param[i] = smsg->r.value[i]; - } - - return XAF_NO_ERROR; -} -#ifdef XAF_HOSTLESS -XAF_ERR_CODE xaf_comp_get_status(xaf_adev_t *p_adev, xaf_comp_t *p_comp, xaf_comp_status *p_status, void *p_info) -#else -XAF_ERR_CODE xaf_comp_get_status(void *adev_ptr, void *comp_ptr, xaf_comp_status *p_status, xaf_info_t *p_info) -#endif -{ - xaf_adev_t *p_adev; - xaf_comp_t *p_comp; - xf_handle_t *p_handle; - - p_adev = (xaf_adev_t *)adev_ptr; - p_comp = (xaf_comp_t *)comp_ptr; - - XAF_CHK_PTR(p_comp); - XAF_CHK_PTR(p_status); - XAF_CHK_PTR(p_info); - if (!p_comp->init_done) XAF_CHK_PTR(p_adev); - - p_handle = &p_comp->handle; - - if (p_comp->pending_resp) - { - xf_user_msg_t rmsg; - /* ...wait until result is delivered */ - XF_CHK_API(xf_response_get(p_handle, &rmsg)); - - if (rmsg.opcode == XF_FILL_THIS_BUFFER) - { - if (rmsg.buffer == p_comp->start_buf) - { - XF_CHK_API(xaf_comp_post_init_config(p_adev, p_comp, p_comp->start_buf)); - } - else - { -#ifdef XAF_HOSTLESS - s32 *p_buf = (s32 *) p_info; - p_buf[0] = (s32) rmsg.buffer; - p_buf[1] = (s32) rmsg.length; -#else - p_info->buf = (void*) rmsg.buffer; - p_info->length = (s32) rmsg.length; -#endif - if (!p_comp->inpool && p_comp->outpool) p_comp->pending_resp--; - - if (!rmsg.length) p_comp->comp_status = XAF_EXEC_DONE; - else - { - p_comp->comp_status = XAF_OUTPUT_READY; - p_comp->expect_out_cmd++; - } - } - } - else - { - /* ...make sure response is expected */ - XF_CHK_ERR(rmsg.opcode == (u32) XF_EMPTY_THIS_BUFFER, XAF_API_ERR); -#ifdef XAF_HOSTLESS - s32 *p_buf = (s32 *) p_info; - p_buf[0] = (s32) rmsg.buffer; - p_buf[1] = (s32) rmsg.length; -#else - p_info->buf = (void*) rmsg.buffer; - p_info->length = (s32) rmsg.length; -#endif - p_comp->pending_resp--; - - if (p_comp->input_over && rmsg.buffer == NULL) p_comp->comp_status = XAF_EXEC_DONE; - else p_comp->comp_status = XAF_NEED_INPUT; - } - } - else if ((p_comp->comp_status == XAF_STARTING && p_comp->start_cmd_issued) || - (p_comp->comp_status == XAF_INIT_DONE && p_comp->exec_cmd_issued)) - { - if (p_comp->inpool) p_comp->comp_status = XAF_NEED_INPUT; - } - - *p_status = p_comp->comp_status; - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_comp_process(void *adev_ptr, void *comp_ptr, void *p_buf, u32 length, xaf_comp_flag flag) -{ - xaf_adev_t *p_adev; - xaf_comp_t *p_comp; - xf_handle_t *p_handle; - - p_adev = (xaf_adev_t *)adev_ptr; - p_comp = (xaf_comp_t *)comp_ptr; - - XAF_CHK_PTR(p_comp); - if (!p_comp->init_done) XAF_CHK_PTR(p_adev); - XAF_CHK_RANGE(flag, XAF_START_FLAG, XAF_NEED_OUTPUT_FLAG); - if (flag == XAF_INPUT_READY_FLAG) XAF_CHK_RANGE(length, 0, XAF_INBUF_SIZE); - - p_handle = &p_comp->handle; - - switch (flag) - { - case XAF_START_FLAG: - if (p_comp->start_cmd_issued) - break; - else - { - p_comp->start_buf = xf_buffer_data(p_handle->aux); - XF_CHK_API(xf_command(p_handle, (p_comp->inp_ports), XF_FILL_THIS_BUFFER, p_comp->start_buf, 0)); - p_comp->start_cmd_issued = 1; - - if(p_comp->comp_type != XAF_DECODER) - { - xf_user_msg_t rmsg; - /* ...wait until result is delivered */ - XF_CHK_API(xf_response_get(p_handle, &rmsg)); - - /* ...make sure response is expected */ - XF_CHK_ERR(rmsg.opcode == XF_FILL_THIS_BUFFER && rmsg.buffer == p_comp->start_buf, XAF_API_ERR); - - XF_CHK_API(xaf_comp_post_init_config(p_adev, p_comp, p_comp->start_buf)); - } - } - break; - - case XAF_EXEC_FLAG: - if (!p_comp->init_done || p_comp->exec_cmd_issued) - break; - p_comp->exec_cmd_issued = 1; - if (p_comp->outpool) - { - u32 i; - xf_buffer_t *p_buf; - void *p_data; - - for (i=0; i<p_comp->noutbuf; i++) - { - p_buf = xf_buffer_get(p_comp->outpool); - p_data = xf_buffer_data(p_buf); - - XF_CHK_API(xf_command(&p_comp->handle, (p_comp->inp_ports), XF_FILL_THIS_BUFFER, p_data, p_comp->out_format.output_length)); - } - - if (!p_comp->inpool) p_comp->pending_resp = p_comp->noutbuf; - } - break; - - case XAF_INPUT_OVER_FLAG: - if (!p_comp->input_over) - { - XF_CHK_API(xf_command(p_handle, 0, XF_EMPTY_THIS_BUFFER, NULL, 0)); - p_comp->input_over = 1; - p_comp->pending_resp++; - } - break; - - case XAF_INPUT_READY_FLAG: - if (!p_comp->input_over) - { - XAF_CHK_PTR(p_buf); - XF_CHK_API(xf_command(p_handle, 0, XF_EMPTY_THIS_BUFFER, p_buf, length)); - p_comp->pending_resp++; - } - break; - - case XAF_NEED_OUTPUT_FLAG: - if (p_comp->expect_out_cmd) - { - XAF_CHK_PTR(p_buf); - XF_CHK_API(xf_command(p_handle, (p_comp->inp_ports), XF_FILL_THIS_BUFFER, p_buf, length)); - p_comp->expect_out_cmd--; - - if (!p_comp->inpool && p_comp->outpool) p_comp->pending_resp++; - } - break; - } - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_connect(void *src_ptr, void *dest_ptr, s32 num_buf) -{ - xaf_comp_t *p_src; - xaf_comp_t *p_dest; - - p_src = (xaf_comp_t *)src_ptr; - p_dest = (xaf_comp_t *)dest_ptr; - - XAF_CHK_PTR(p_src); - XAF_CHK_PTR(p_dest); - XAF_CHK_RANGE(num_buf, 2, 4); - - if (!p_src->init_done || p_src->out_routed == p_src->out_ports || p_dest->inp_routed == p_dest->inp_ports) - return XAF_ROUTING_ERROR; - - XF_CHK_API(xf_route(&p_src->handle, (p_src->inp_ports + p_src->out_routed), &p_dest->handle, (p_dest->inp_routed), num_buf, p_src->out_format.output_length, 8)); - - p_src->out_routed++; - p_dest->inp_routed++; - - return XAF_NO_ERROR; -} - -XAF_ERR_CODE xaf_disconnect(xaf_comp_t *p_comp) -{ - XAF_CHK_PTR(p_comp); - - /* ...tbd - support for multiple output ports */ - if (!p_comp->init_done || p_comp->out_routed != p_comp->out_ports) - return XAF_ROUTING_ERROR; - - XF_CHK_API(xf_unroute(&p_comp->handle, (p_comp->inp_ports))); - - return XAF_NO_ERROR; -} - - - - - - diff --git a/hifi/xaf/host-apf/proxy/xf-fio.c b/hifi/xaf/host-apf/proxy/xf-fio.c deleted file mode 100644 index 5c3c3dbf..00000000 --- a/hifi/xaf/host-apf/proxy/xf-fio.c +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MODULE_TAG FIO - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" -#include <sys/ioctl.h> -#include <sys/mman.h> - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(CMD, 1); -TRACE_TAG(RSP, 1); - -/******************************************************************************* - * Local constants - tbd - ******************************************************************************/ - -/* ...proxy setup ioctl */ -#define XF_PROXY_SETUP_IOCTL _IO('P', 0x0) - -/* ...proxy close ioctl */ -#define XF_PROXY_CLOSE_IOCTL _IO('P', 0x1) - -#define HIFI_DSP_MISC_DRIVER "/dev/hifi_misc" -#ifndef GJB_COMMENT -#define HIFI_MISC_IOCTL_XAF_IPC_MSG_SEND _IOW('A', 0x7c, xf_proxy_message_driv_t) -#define HIFI_MISC_IOCTL_XAF_IPC_MSG_RECV _IOR('A', 0x7d, xf_proxy_message_driv_t) -#define HIFI_MISC_IOCTL_XAF_IPC_VMSG_PTR _IOR('A', 0x7e, xf_proxy_message_driv_t) -#endif -//u8 remote_ipc_pool[XF_CFG_REMOTE_IPC_POOL_SIZE]; -/******************************************************************************* - * Internal IPC API implementation - ******************************************************************************/ - -/* ...pass command to remote DSP */ -int xf_ipc_send(xf_proxy_ipc_data_t *ipc, xf_proxy_msg_t *msg, void *b) -{ - /* ...unused arg */ - (void) b; - - int fd = ipc->fd; - int ret; -#ifdef GJB_COMMENT - TRACE(CMD, _b("C[%08x]:(%x,%08x,%u)"), msg->id, msg->opcode, msg->address, msg->length); - - /* ...pass message to kernel driver */ - XF_CHK_ERR(write(fd, msg, sizeof(*msg)) == sizeof(*msg), -errno); -#else - ret = ioctl(fd, HIFI_MISC_IOCTL_XAF_IPC_MSG_SEND, msg);// GJB:-Verify th return value with driver implementation. -#endif - - /* ...communication mutex is still locked! */ - return 0; -} - -/* ...wait for response availability */ -int xf_ipc_wait(xf_proxy_ipc_data_t *ipc, u32 timeout) -{ - int fd = ipc->fd; - fd_set rfds; - struct timeval tv; - - /* ...specify waiting set */ - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - - /* ...set timeout value if given */ - (timeout ? tv.tv_sec = timeout / 1000, tv.tv_usec = (timeout % 1000) * 1000 : 0); - - /* ...wait until there is a data in file */ -// XF_CHK_ERR(select(fd + 1, &rfds, NULL, NULL, (timeout ? &tv : NULL)) >= 0, -errno); - select(fd+1,&rfds,NULL,NULL,(timeout? &tv: NULL)); - - /* ...check if descriptor is set */ - return (FD_ISSET(fd, &rfds) ? 0 : -ETIMEDOUT); -} - -/* ...read response from proxy */ -int xf_ipc_recv(xf_proxy_ipc_data_t *ipc, xf_proxy_msg_t *msg, void **buffer) -{ - int fd = ipc->fd; - int r; - xf_proxy_msg_t temp; -#ifdef GJB_COMMENT - /* ...get message header from file */ - if ((r = read(fd, msg, sizeof(*msg))) == sizeof(*msg)) - { - TRACE(RSP, _b("R[%08x]:(%x,%u,%08x)"), msg->id, msg->opcode, msg->length, msg->address); - - /* ...translate shared address into local pointer */ - XF_CHK_ERR((*buffer = xf_ipc_a2b(ipc, msg->address)) != (void *)-1, -EBADFD); - - /* ...return positive result indicating the message has been received */ - return sizeof(*msg); - } -#else - if ((r = ioctl(fd, HIFI_MISC_IOCTL_XAF_IPC_MSG_RECV, &temp)) == sizeof(temp)) - { - msg->id = temp.id; - msg->opcode = temp.opcode; - msg->length = temp.length; - *buffer = xf_ipc_a2b(ipc, temp.address); - /* ...translate shared address into local pointer */ - XF_CHK_ERR((*buffer = xf_ipc_a2b(ipc, temp.address)) != (void *)-1, -EBADFD); - msg->address = temp.address; - return sizeof(*msg); - } -#endif - else - { - /* ...if no response is available, return 0 result */ - return XF_CHK_API(errno == EAGAIN ? 0 : -errno); - } -} - -/******************************************************************************* - * Internal API functions implementation - ******************************************************************************/ - -/* ...open proxy interface on proper DSP partition */ -int xf_ipc_open(xf_proxy_ipc_data_t *ipc, u32 core, void *p_shmem) -{ - //XF_CHK_ERR((p_shmem != NULL), -errno); - //size_t xf_cfg_remote_ipc_pool_size = *(size_t *)p_shmem;//user configured shmem pool size: minimum 256 KB - /* ...unused arg */ - (void) p_shmem; -#ifdef GJB_COMMENT - /* ...open file handle */ - XF_CHK_ERR((ipc->fd = open("/dev/xtensa-proxy", O_RDWR)) >= 0, -errno); - - /* ...pass shread memory core for this proxy instance */ - XF_CHK_ERR(ioctl(ipc->fd, XF_PROXY_SETUP_IOCTL, core) >= 0, -errno); -#else - XF_CHK_ERR((ipc->fd = open(HIFI_DSP_MISC_DRIVER, O_RDWR,0)) >= 0, -errno); -#endif - /* ...create pipe for asynchronous response delivery */ - XF_CHK_ERR(pipe(ipc->pipe) == 0, -errno); - - /* ...map entire shared memory region (not too good - tbd) */ -// ipc->shmem = remote_ipc_pool; -// ioctl(ipc->fd, HIFI_MISC_IOCTL_XAF_IPC_VMSG_PTR, ipc->shmem); -#if 1 - //allocate 256 KB constant size - XF_CHK_ERR((ipc->shmem = mmap(NULL, XF_CFG_REMOTE_IPC_POOL_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, ipc->fd, 0)) != MAP_FAILED, -errno); -#else - XF_CHK_ERR((ipc->shmem = mmap(NULL, xf_cfg_remote_ipc_pool_size, PROT_READ | PROT_WRITE, MAP_SHARED, ipc->fd, 0)) != MAP_FAILED, -errno); -#endif - TRACE(INIT, _b("proxy-%u interface opened"), core); - return 0; -} - -/* ...close proxy handle */ -void xf_ipc_close(xf_proxy_ipc_data_t *ipc, u32 core) -{ - /* ...unmap shared memory region */ -// (void)munmap(ipc->shmem, XF_CFG_REMOTE_IPC_POOL_SIZE); - - /* ...close asynchronous response delivery pipe */ - close(ipc->pipe[0]), close(ipc->pipe[1]); - - /* ...close proxy file handle */ - close(ipc->fd); - - TRACE(INIT, _b("proxy-%u interface closed"), core); -} - diff --git a/hifi/xaf/host-apf/proxy/xf-proxy.c b/hifi/xaf/host-apf/proxy/xf-proxy.c deleted file mode 100644 index 9487f4ea..00000000 --- a/hifi/xaf/host-apf/proxy/xf-proxy.c +++ /dev/null @@ -1,686 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MODULE_TAG PROXY - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "xf.h" - -/******************************************************************************* - * Tracing configuration - ******************************************************************************/ - -TRACE_TAG(INIT, 1); -TRACE_TAG(CMD, 1); -TRACE_TAG(EXEC, 1); -TRACE_TAG(RSP, 1); -TRACE_TAG(REG, 1); -TRACE_TAG(MEM, 1); -TRACE_TAG(GRAPH, 1); -TRACE_TAG(BUFFER, 1); - -/******************************************************************************* - * Internal functions definitions - ******************************************************************************/ - -/* ...execute proxy command synchronously */ -static inline int xf_proxy_cmd_exec(xf_proxy_t *proxy, xf_user_msg_t *msg) -{ - xf_proxy_msg_t m; - - /* ...send command to remote proxy */ - m.id = msg->id, m.opcode = msg->opcode, m.length = msg->length; - - /* ...translate address */ - XF_CHK_ERR((m.address = xf_proxy_b2a(proxy, msg->buffer)) != XF_PROXY_BADADDR, -EINVAL); - - /* ...pass command to remote proxy */ - XF_CHK_API(xf_ipc_send(&proxy->ipc, &m, msg->buffer)); - - /* ...wait for response reception indication from proxy thread */ - XF_CHK_API(xf_proxy_response_get(proxy, &m)); - - /* ...copy parameters */ - msg->id = m.id, msg->opcode = m.opcode, msg->length = m.length; - - /* ...translate address back to virtual space */ - XF_CHK_ERR((msg->buffer = xf_proxy_a2b(proxy, m.address)) != (void *)-1, -EBADFD); - - TRACE(EXEC, _b("proxy[%p]: command done: [%08x:%p:%u]"), proxy, msg->opcode, msg->buffer, msg->length); - - return 0; -} - -#if 0 -/* ...pass command to remote DSP */ -static inline int xf_proxy_cmd(xf_proxy_t *proxy, xf_handle_t *handle, xf_user_msg_t *m) -{ - xf_proxy_msg_t msg; - - /* ...set session-id of the message */ - msg.id = __XF_MSG_ID(__XF_AP_CLIENT(proxy->core, handle->client), m->id); - msg.opcode = m->opcode; - msg.length = m->length; - - /* ...translate buffer pointer to shared address */ - XF_CHK_ERR((msg.address = xf_proxy_b2a(proxy, m->buffer)) != XF_PROXY_BADADDR, -EINVAL); - - /* ...submit command message to IPC layer */ - return XF_CHK_API(xf_ipc_send(&proxy->ipc, &msg, m->buffer)); -} -#endif /* 0 */ - -/* ...allocate local client-id number */ -static inline u32 xf_client_alloc(xf_proxy_t *proxy, xf_handle_t *handle) -{ - u32 client; - - if ((client = proxy->cmap[0].next) != 0) - { - /* ...pop client from free clients list */ - proxy->cmap[0].next = proxy->cmap[client].next; - - /* ...put client handle into association map */ - handle->client = client, proxy->cmap[client].handle = handle; - } - - return client; -} - -/* ...recycle local client-id number */ -static inline void xf_client_free(xf_proxy_t *proxy, xf_handle_t *handle) -{ - u32 client = handle->client; - - /* ...push client into head of the free clients list */ - proxy->cmap[client].next = proxy->cmap[0].next; - - /* ...adjust head of free clients */ - proxy->cmap[0].next = client; -} - -/* ...lookup client basing on its local id */ -static inline xf_handle_t * xf_client_lookup(xf_proxy_t *proxy, u32 client) -{ - /* ...client index must be in proper range */ - BUG(client >= XF_CFG_PROXY_MAX_CLIENTS, _x("Invalid client index: %u"), client); - - /* ...check if client index is small */ - if (proxy->cmap[client].next < XF_CFG_PROXY_MAX_CLIENTS) - return NULL; - else - return proxy->cmap[client].handle; -} - -/* ...create new client on remote core */ -static inline int xf_client_register(xf_proxy_t *proxy, xf_handle_t *handle, xf_id_t id, u32 core) -{ - void *b = xf_handle_aux(handle); - xf_user_msg_t msg; - - /* ...set session-id: source is local proxy, destination is remote proxy */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(proxy->core), __XF_DSP_PROXY(core)); - msg.opcode = XF_REGISTER; - msg.buffer = b; - msg.length = strlen(id) + 1; - - /* ...copy component identifier */ - strncpy(b, id, xf_buffer_length(handle->aux)); - - /* ...execute command synchronously */ - XF_CHK_API(xf_proxy_cmd_exec(proxy, &msg)); - - /* ...check operation is successfull */ - XF_CHK_ERR(msg.opcode == (u32) XF_REGISTER, -EFAULT); - - /* ...save received component global client-id */ - handle->id = XF_MSG_SRC(msg.id); - - TRACE(REG, _b("[%p]=[%s:%u:%u]"), handle, id, XF_PORT_CORE(handle->id), XF_PORT_CLIENT(handle->id)); - - return 0; -} - -/* ...unregister client from remote proxy */ -static inline int xf_client_unregister(xf_proxy_t *proxy, xf_handle_t *handle) -{ - xf_user_msg_t msg; - - /* ...make sure the client is consistent */ - BUG(proxy->cmap[handle->client].handle != handle, _x("Invalid handle: %p"), handle); - - /* ...set message parameters */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(proxy->core), handle->id); - msg.opcode = XF_UNREGISTER; - msg.buffer = NULL; - msg.length = 0; - - /* ...synchronously execute command on remote proxy */ - XF_CHK_API(xf_proxy_cmd_exec(proxy, &msg)); - - /* ...opcode must be XF_UNREGISTER - tbd */ - BUG(msg.opcode != XF_UNREGISTER, _x("Invalid opcode: %X"), msg.opcode); - - TRACE(REG, _b("%p[%u:%u] unregistered"), handle, XF_PORT_CORE(handle->id), XF_PORT_CLIENT(handle->id)); - - return 0; -} - -/* ...allocate shared buffer */ -static inline int xf_proxy_buffer_alloc(xf_proxy_t *proxy, u32 length, void **buffer) -{ - u32 core = proxy->core; - xf_user_msg_t msg; - - /* ...prepare command parameters */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(core), __XF_DSP_PROXY(core)); - msg.opcode = XF_ALLOC; - msg.length = length; - msg.buffer = NULL; - - /* ...synchronously execute command on remote proxy */ - XF_CHK_API(xf_proxy_cmd_exec(proxy, &msg)); - - /* ...check if response is valid */ - XF_CHK_ERR(msg.opcode == XF_ALLOC, -EBADFD); - - /* ...check if allocation is successful */ - XF_CHK_ERR(msg.buffer != NULL, -ENOMEM); - - /* ...save output parameter */ - *buffer = msg.buffer; - - TRACE(MEM, _b("proxy-%u: allocated [%p:%u]"), core, *buffer, length); - - return 0; -} - -/* ...free shared AP-DSP memory */ -static inline int xf_proxy_buffer_free(xf_proxy_t *proxy, void *buffer, u32 length) -{ - u32 core = proxy->core; - xf_user_msg_t msg; - - /* ...prepare command parameters */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(core), __XF_DSP_PROXY(core)); - msg.opcode = XF_FREE; - msg.length = length; - msg.buffer = buffer; - - /* ...synchronously execute command on remote proxy */ - XF_CHK_API(xf_proxy_cmd_exec(proxy, &msg)); - - /* ...check if response is valid */ - XF_CHK_ERR(msg.opcode == XF_FREE, -EBADFD); - - TRACE(MEM, _b("proxy-%u: free [%p:%u]"), core, buffer, length); - - return 0; -} - -/******************************************************************************* - * Proxy interface asynchronous receiving thread - ******************************************************************************/ - -static void * xf_proxy_thread(void *arg) -{ - xf_proxy_t *proxy = arg; - xf_handle_t *client; - int r; - - /* ...start polling thread */ - while (1) - { - xf_proxy_msg_t m; - xf_user_msg_t msg; - - /* ...wait for response from remote proxy (infinite timeout) */ - if ((r = xf_ipc_wait(&proxy->ipc, 0)) < 0) - break; - - /* ...retrieve all responses received */ - while ((r = xf_ipc_recv(&proxy->ipc, &m, &msg.buffer)) == sizeof(m)) - { - /* ...make sure we have proper core identifier of SHMEM interface */ - BUG(XF_MSG_DST_CORE(m.id) != proxy->core, _x("Invalid session-id: %X (core=%u)"), m.id, proxy->core); - - /* ...make sure translation is successful */ - BUG(msg.buffer == (void *)-1, _x("Invalid buffer address: %08x"), m.address); - - /* ...retrieve information fields */ - msg.id = XF_MSG_SRC(m.id), msg.opcode = m.opcode, msg.length = m.length; - - TRACE(RSP, _b("R[%08x]:(%08x,%u,%08x)"), m.id, m.opcode, m.length, m.address); - - /* ...lookup component basing on destination port specification */ - if (XF_AP_CLIENT(m.id) == 0) - { - /* ...put proxy response to local IPC queue */ - xf_proxy_response_put(proxy, &m); - } - else if ((client = xf_client_lookup(proxy, XF_AP_CLIENT(m.id))) != NULL) - { - /* ...client is found; invoke its response callback (must be non-blocking) */ - client->response(client, &msg); - } - else - { - /* ...client has been disconnected already; drop message */ - TRACE(RSP, _b("Client look-up failed - drop message")); - } - } - - /* ...if result code is negative; terminate thread operation */ - if (r < 0) - { - TRACE(ERROR, _x("abnormal proxy[%p] thread termination: %d"), proxy, r); - break; - } - } - - TRACE(INIT, _b("IPC proxy[%p] thread terminated: %d"), proxy, r); - - return (void *)(intptr_t)r; -} - -/******************************************************************************* - * HiFi proxy API - ******************************************************************************/ - -/* ...open HiFi proxy */ -int xf_proxy_init(xf_proxy_t *proxy, u32 core, void *p_shmem) -{ - u32 i; - int r; - - /* ...initialize proxy lock */ - __xf_lock_init(&proxy->lock); - - /* ...open proxy IPC interface */ - XF_CHK_API(xf_ipc_open(&proxy->ipc, core, p_shmem)); - - /* ...save proxy core - hmm, too much core identifiers - tbd */ - proxy->core = core; - - /* ...line-up all clients into single-linked list */ - for (i = 0; i < XF_CFG_PROXY_MAX_CLIENTS - 1; i++) - { - proxy->cmap[i].next = i + 1; - } - - /* ...tail of the list points back to head (list terminator) */ - proxy->cmap[i].next = 0; - - /* ...initialize thread attributes (joinable, with minimal stack) */ - if ((r = __xf_thread_create(&proxy->thread, xf_proxy_thread, proxy)) < 0) - { - TRACE(ERROR, _x("Failed to create polling thread: %d"), r); - xf_ipc_close(&proxy->ipc, core); - return r; - } - - TRACE(INIT, _b("proxy-%u[%p] opened"), core, proxy); - - return 0; -} - -/* ...close proxy handle */ -void xf_proxy_close(xf_proxy_t *proxy) -{ - u32 core = proxy->core; - - /* ...terminate proxy thread */ - __xf_thread_destroy(&proxy->thread); - - /* ...close proxy IPC interface */ - xf_ipc_close(&proxy->ipc, core); - - TRACE(INIT, _b("proxy-%u[%p] closed"), core, proxy); -} - -/******************************************************************************* - * HiFi component API - ******************************************************************************/ - -/* ...open component handle */ -int xf_open(xf_proxy_t *proxy, xf_handle_t *handle, xf_id_t id, u32 core, xf_response_cb response) -{ - int r; - - /* ...retrieve auxiliary control buffer from proxy - need I */ - XF_CHK_ERR(handle->aux = xf_buffer_get(proxy->aux), -EBUSY); - - /* ...initialize IPC data */ - XF_CHK_API(xf_ipc_data_init(&handle->ipc)); - - /* ...register client in interlocked fashion */ - xf_proxy_lock(proxy); - - /* ...allocate local client */ - if (xf_client_alloc(proxy, handle) == 0) - { - TRACE(ERROR, _x("client allocation failed")); - r = -EBUSY; - } - else if ((r = xf_client_register(proxy, handle, id, core)) < 0) - { - TRACE(ERROR, _x("client registering failed")); - xf_client_free(proxy, handle); - } - - xf_proxy_unlock(proxy); - - /* ...if failed, release buffer handle */ - if (r < 0) - { - /* ...operation failed; return buffer back to proxy pool */ - xf_buffer_put(handle->aux), handle->aux = NULL; - } - else - { - /* ...operation completed successfully; assign handle data */ - handle->response = response; - handle->proxy = proxy; - - TRACE(INIT, _b("component[%p]:(id=%s,core=%u) created"), handle, id, core); - } - - return XF_CHK_API(r); -} - -/* ...close component handle */ -void xf_close(xf_handle_t *handle) -{ - xf_proxy_t *proxy = handle->proxy; - - /* ...do I need to take component lock here? guess no - tbd */ - - /* ...buffers and stuff? - tbd */ - - /* ...acquire global proxy lock */ - xf_proxy_lock(proxy); - - /* ...unregister component from remote DSP proxy (ignore result code) */ - (void) xf_client_unregister(proxy, handle); - - /* ...recycle client-id afterwards */ - xf_client_free(proxy, handle); - - /* ...release global proxy lock */ - xf_proxy_unlock(proxy); - - /* ...destroy IPC data */ - xf_ipc_data_destroy(&handle->ipc); - - /* ...clear handle data */ - xf_buffer_put(handle->aux), handle->aux = NULL; - - /* ...wipe out proxy pointer */ - handle->proxy = NULL; - - TRACE(INIT, _b("component[%p] destroyed"), handle); -} - -/* ...port binding function */ -int xf_route(xf_handle_t *src, u32 src_port, xf_handle_t *dst, u32 dst_port, u32 num, u32 size, u32 align) -{ - xf_proxy_t *proxy = src->proxy; - xf_buffer_t *b; - xf_route_port_msg_t *m; - xf_user_msg_t msg; - - /* ...sanity checks - proxy pointers are same */ - XF_CHK_ERR(proxy == dst->proxy, -EINVAL); - - /* ...buffer data is sane */ - XF_CHK_ERR(num && size && xf_is_power_of_two(align), -EINVAL); - - /* ...get control buffer */ - XF_CHK_ERR(b = xf_buffer_get(proxy->aux), -EBUSY); - - /* ...get message buffer */ - m = xf_buffer_data(b); - - /* ...fill-in message parameters */ - //m->src = __XF_PORT_SPEC2(src->id, src_port); - m->dst = __XF_PORT_SPEC2(dst->id, dst_port); - m->alloc_number = num; - m->alloc_size = size; - m->alloc_align = align; - - /* ...set command parameters */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(proxy->core), __XF_PORT_SPEC2(src->id, src_port)); - msg.opcode = XF_ROUTE; - msg.length = sizeof(*m); - msg.buffer = m; - - /* ...synchronously execute command on remote DSP */ - XF_CHK_API(xf_proxy_cmd_exec(proxy, &msg)); - - /* ...return buffer to proxy */ - xf_buffer_put(b); - - /* ...check result is successfull */ - XF_CHK_ERR(msg.opcode == (u32) XF_ROUTE, -ENOMEM); - - /* ...port binding completed */ - TRACE(GRAPH, _b("[%p]:%u bound to [%p]:%u"), src, src_port, dst, dst_port); - - return 0; -} - -/* ...port unbinding function */ -int xf_unroute(xf_handle_t *src, u32 src_port) -{ - xf_proxy_t *proxy = src->proxy; - xf_buffer_t *b; - xf_unroute_port_msg_t *m; - xf_user_msg_t msg; - int r; - - /* ...get control buffer */ - XF_CHK_ERR(b = xf_buffer_get(proxy->aux), -EBUSY); - - /* ...get message buffer */ - m = xf_buffer_data(b); - - /* ...fill-in message parameters */ - //m->src = __XF_PORT_SPEC2(src->id, src_port); - - /* ...set command parameters */ - msg.id = __XF_MSG_ID(__XF_AP_PROXY(proxy->core), __XF_PORT_SPEC2(src->id, src_port)); - msg.opcode = XF_UNROUTE; - msg.length = sizeof(*m); - msg.buffer = m; - - /* ...synchronously execute command on remote DSP */ - if ((r = xf_proxy_cmd_exec(proxy, &msg)) != 0) - { - TRACE(ERROR, _x("Command failed: %d"), r); - goto out; - } - else if (msg.opcode != (u32) XF_UNROUTE) - { - TRACE(ERROR, _x("Port unbinding failed")); - r = -EBADFD; - goto out; - } - - /* ...port binding completed */ - TRACE(GRAPH, _b("[%p]:%u unbound"), src, src_port); - -out: - /* ...return buffer to proxy */ - xf_buffer_put(b); - - return r; -} - -/* ...send a command message to component */ -int xf_command(xf_handle_t *handle, u32 port, u32 opcode, void *buffer, u32 length) -{ - xf_proxy_t *proxy = handle->proxy; - xf_proxy_msg_t msg; - - /* ...fill-in message parameters */ - msg.id = __XF_MSG_ID(__XF_AP_CLIENT(proxy->core, handle->client), __XF_PORT_SPEC2(handle->id, port)); - msg.opcode = opcode; - msg.length = length; - XF_CHK_ERR((msg.address = xf_proxy_b2a(proxy, buffer)) != XF_PROXY_BADADDR, -EINVAL); - - TRACE(CMD, _b("[%p]:[%08x]:(%08x,%u,%p)"), handle, msg.id, opcode, length, buffer); - - /* ...pass command to IPC layer */ - return XF_CHK_API(xf_ipc_send(&proxy->ipc, &msg, buffer)); -} - -/******************************************************************************* - * Buffer pool API - ******************************************************************************/ - -/* ...allocate buffer pool */ -int xf_pool_alloc(xf_proxy_t *proxy, u32 number, u32 length, xf_pool_type_t type, xf_pool_t **pool, s32 id, - xaf_mem_malloc_fxn_t xaf_malloc, xaf_mem_free_fxn_t xaf_free) -{ - xf_pool_t *p; - xf_buffer_t *b; - void *data; - int r; - - /* ...unused arg */ - (void) type; - - /* ...basic sanity checks; number of buffers is positive */ - XF_CHK_ERR(number > 0, -EINVAL); - - /* ...get properly aligned buffer length */ - length = (length + XF_PROXY_ALIGNMENT - 1) & ~(XF_PROXY_ALIGNMENT - 1); - - /* ...allocate data structure */ - p = xaf_malloc(offset_of(xf_pool_t, buffer) + number * sizeof(xf_buffer_t), id); - XF_CHK_ERR(p, -ENOMEM); - - /* ...issue memory pool allocation request to remote DSP */ - xf_proxy_lock(proxy); - r = xf_proxy_buffer_alloc(proxy, number * length, &p->p); - xf_proxy_unlock(proxy); - - /* ...if operation is failed, do cleanup */ - if (r < 0) - { - TRACE(ERROR, _x("failed to allocate buffer: %d"), r); - xaf_free(p, id); - return r; - } - else - { - /* ...set pool parameters */ - p->number = number, p->length = length; - p->proxy = proxy; - } - - /* ...create individual buffers and link them into free list */ - for (p->free = b = &p->buffer[0], data = p->p; number > 0; number--, b++) - { - /* ...set address of the buffer (no length there) */ - b->address = data; - - /* ...file buffer into the free list */ - b->link.next = b + 1; - - /* ...advance data pointer in contiguous buffer */ - data = (unsigned char *) data + length; - } - - /* ...terminate list of buffers (not too good - tbd) */ - b[-1].link.next = NULL; - - TRACE(BUFFER, _b("[%p]: pool[%p] created: %u * %u"), proxy, p, p->number, p->length); - - /* ...return buffer pointer */ - *pool = p; - - return 0; -} - -/* ...buffer pool destruction */ -void xf_pool_free(xf_pool_t *pool, s32 id, xaf_mem_free_fxn_t xaf_free) -{ - xf_proxy_t *proxy = pool->proxy; - - /* ...check buffers are all freed - tbd */ - - /* ...use global proxy lock for pool operations protection */ - xf_proxy_lock(proxy); - - /* ...release allocated buffer on remote DSP */ - xf_proxy_buffer_free(proxy, pool->p, pool->length * pool->number); - - /* ...release global proxy lock */ - xf_proxy_unlock(proxy); - - /* ...deallocate pool structure itself */ - xaf_free(pool, id); - - TRACE(BUFFER, _b("[%p]::pool[%p] destroyed"), proxy, pool); -} - -/* ...get new buffer from a pool */ -xf_buffer_t * xf_buffer_get(xf_pool_t *pool) -{ - xf_buffer_t *b; - - /* ...use global proxy lock for pool operations protection */ - xf_proxy_lock(pool->proxy); - - /* ...take buffer from a head of the free list */ - if ((b = pool->free) != NULL) - { - /* ...advance free list head */ - pool->free = b->link.next, b->link.pool = pool; - - TRACE(BUFFER, _b("pool[%p]::get[%p]"), pool, b); - } - - xf_proxy_unlock(pool->proxy); - - return b; -} - -/* ...return buffer back to pool */ -void xf_buffer_put(xf_buffer_t *buffer) -{ - xf_pool_t *pool = buffer->link.pool; - - /* ...use global proxy lock for pool operations protection */ - xf_proxy_lock(pool->proxy); - - /* ...put buffer back to a pool */ - buffer->link.next = pool->free, pool->free = buffer; - - TRACE(BUFFER, _b("pool[%p]::put[%p]"), pool, buffer); - - xf_proxy_unlock(pool->proxy); -} diff --git a/hifi/xaf/host-apf/proxy/xf-trace.c b/hifi/xaf/host-apf/proxy/xf-trace.c deleted file mode 100644 index fb902676..00000000 --- a/hifi/xaf/host-apf/proxy/xf-trace.c +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include "xf.h" -#include <sys/time.h> - -#if XF_TRACE -/******************************************************************************* - * Local data definitions - ******************************************************************************/ - -/* ...tracing lock */ -static pthread_mutex_t xf_trace_mutex; - -/******************************************************************************* - * Tracing facility - ******************************************************************************/ - -/* ...timestamp function */ -static u32 xf_timenow(void) -{ - struct timeval tv; - - /* ...get current time value */ - gettimeofday(&tv, NULL); - - /* ...wrap over every 100 seconds */ - return (u32)((tv.tv_sec % 100) * 1000000 + tv.tv_usec); -} - -/* ...tracing initialization */ -void xf_trace_init(const char *banner) -{ - /* ...initialize tracing lock */ - pthread_mutex_init(&xf_trace_mutex, NULL); - - /* ...output banner */ - xf_trace(banner); -} - -/* ...tracing primitive */ -int xf_trace(const char *format, ...) -{ - va_list args; - static char buf[256]; - char *b = buf; - - /* ...get global tracing lock */ - pthread_mutex_lock(&xf_trace_mutex); - - /* ...output timestamp */ - b += sprintf(b, "[%08u] ", xf_timenow()); - - /* ...output format string */ - va_start(args, format); - b += vsprintf(b, format, args); - va_end(args); - - /* ...put terminator */ - *b = '\0'; - - /* ...output prepared string */ - __xf_puts(buf); - - /* ...release tracing lock */ - pthread_mutex_unlock(&xf_trace_mutex); - - return 0; -} - -#endif /* XF_TRACE */ diff --git a/hifi/xaf/host-apf/tools/dhifimesg b/hifi/xaf/host-apf/tools/dhifimesg Binary files differdeleted file mode 100755 index 88294880..00000000 --- a/hifi/xaf/host-apf/tools/dhifimesg +++ /dev/null diff --git a/hifi/xaf/host-apf/utest/include/xaf-mem.h b/hifi/xaf/host-apf/utest/include/xaf-mem.h deleted file mode 100644 index 68838035..00000000 --- a/hifi/xaf/host-apf/utest/include/xaf-mem.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MEM_NUM_MEM_ALLOC 32 - -typedef struct { - void* heap_ptr; - int size; -}mem_obj_dev_t; - -typedef struct { - void* heap_ptr; - int size; -}mem_obj_comp_t; - -typedef struct { - mem_obj_dev_t mem_dev[MEM_NUM_MEM_ALLOC]; - mem_obj_comp_t mem_comp[MEM_NUM_MEM_ALLOC]; - int num_malloc_dev; - int num_malloc_comp; - int persi_mem_dev; - int persi_mem_comp; -}mem_obj_t; - -void* mem_malloc(int size, int id); -void mem_free(void * heap_ptr, int id); -void* mem_init(); -void mem_exit(); -int mem_get_alloc_size(mem_obj_t* mem_handle, int id); - diff --git a/hifi/xaf/host-apf/utest/include/xaf-utils-test.h b/hifi/xaf/host-apf/utest/include/xaf-utils-test.h deleted file mode 100644 index e6c2ce03..00000000 --- a/hifi/xaf/host-apf/utest/include/xaf-utils-test.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#include <stdio.h> - -#include "xf.h" -#include "xaf-api.h" -#include "xa_type_def.h" - -#include "xaf-mem.h" - -/* exported global variables */ -extern int audio_frmwk_buf_size; -extern int audio_comp_buf_size; - -int print_mem_mcps_info(mem_obj_t* mem_handle, int num_comp); -int print_banner(char *app_name); - diff --git a/hifi/xaf/host-apf/utest/xaf-dec-mix-test.c b/hifi/xaf/host-apf/utest/xaf-dec-mix-test.c deleted file mode 100644 index 28ac8767..00000000 --- a/hifi/xaf/host-apf/utest/xaf-dec-mix-test.c +++ /dev/null @@ -1,421 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MODULE_TAG UTEST - -#include "xaf-utils-test.h" - -#include "audio/xa_vorbis_dec_api.h" -#include "audio/xa-mixer-api.h" -#include "audio/xa-audio-decoder-api.h" - -#include "xa_playback.h" - -#define PRINT_USAGE do { fprintf(stderr, "\nUsage: %s <input-file1> <input-file2>\n", argv[0]); \ - fprintf(stderr, " Only .ogg and .pcm files are supported. \n"); \ - fprintf(stderr, " Playback is configured @ 48kHz, 2 ch, 16 bits pcm. \n"); \ - fprintf(stderr, " <input-file2> is optional. \n"); \ - fprintf(stderr, " pcm output is written to dec-mix-out.pcm, by default. \n\n"); \ - } while(0) - -#define MAX_INP_STRMS 2 -#define NUM_COMP_IN_GRAPH 3 - -/* ...global variables */ -int g_pthread_exit_code=0x12345678; - -/* ...playback format */ -xaf_format_t pb_format; - -/* ...playback device parameters */ -void *pb_handle = NULL; - -void thread_exit_handler(int sig) -{ - /* ...unused arg */ - (void) sig; - - pthread_exit(0); -} - -static int vorbis_setup(void *p_decoder) -{ - int param[2]; - - /* 1: Raw decode, 0: Ogg decode */ - param[0] = XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_FILE_MODE; - param[1] = 0; - - XF_CHK_API(xaf_comp_set_config(p_decoder, 1, ¶m[0])); - - return 0; -} - -static int pcm_setup(void *p_pcm) -{ - int param[6]; - - param[0] = XA_CODEC_CONFIG_PARAM_SAMPLE_RATE; - param[1] = pb_format.sample_rate; - param[2] = XA_CODEC_CONFIG_PARAM_CHANNELS; - param[3] = pb_format.channels; - param[4] = XA_CODEC_CONFIG_PARAM_PCM_WIDTH; - param[5] = pb_format.pcm_width; - - XF_CHK_API(xaf_comp_set_config(p_pcm, 3, ¶m[0])); - - return 0; -} - -static int mixer_setup(void *p_decoder, xaf_format_t *p_format) -{ - int param[6]; - - param[0] = XA_MIXER_CONFIG_PARAM_SAMPLE_RATE; - param[1] = p_format->sample_rate; - param[2] = XA_MIXER_CONFIG_PARAM_CHANNELS; - param[3] = p_format->channels; - param[4] = XA_MIXER_CONFIG_PARAM_PCM_WIDTH; - param[5] = p_format->pcm_width; - - XF_CHK_API(xaf_comp_set_config(p_decoder, 3, ¶m[0])); - - return 0; -} - -static int consume_output(void *p_buf, int buf_length, void *p_output) -{ - XAF_CHK_PTR(p_buf); - XAF_CHK_PTR(p_output); - -#if !defined BOARD - FILE *fp = p_output; - fwrite(p_buf, 1, buf_length, fp); - - if (xa_playback_buf(pb_handle, p_buf, buf_length)) { - TRACE(ERROR, _b("Playback Failed \n")); - return -1; - } -#else -#endif - return 0; -} - -static int read_input(void *p_buf, int buf_length, int *read_length, void *p_input) -{ - XAF_CHK_PTR(p_buf); - XAF_CHK_PTR(read_length); - XAF_CHK_PTR(p_input); - -#if !defined BOARD - FILE *fp = p_input; - *read_length = fread(p_buf, 1, buf_length, fp); -#else -#endif - return 0; -} - -static int comp_process_entry(void *arg) -{ - void *p_comp; - void *p_input, *p_output; - xaf_comp_status comp_status; - xaf_info_t comp_info; - int input_over, read_length; - void * (*arg_arr)[3]; - void *pg_pthread_exit_code = (void*)&g_pthread_exit_code; - - XAF_CHK_PTR(arg); - - arg_arr = arg; - p_comp = (*arg_arr)[0]; - p_input = (*arg_arr)[1]; - p_output = (*arg_arr)[2]; - input_over = 0; - - XF_CHK_API(xaf_comp_process(NULL, p_comp, NULL, 0, XAF_EXEC_FLAG)); - - while (1) - { - XF_CHK_API(xaf_comp_get_status(NULL, p_comp, &comp_status, &comp_info)); - - if (comp_status == XAF_EXEC_DONE) break; - - if (comp_status == XAF_NEED_INPUT && !input_over) - { - void *p_buf = (void *) comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(read_input(p_buf, size, &read_length, p_input)); - - if (read_length) - XF_CHK_API(xaf_comp_process(NULL, p_comp, (void *)comp_info.buf, read_length, XAF_INPUT_READY_FLAG)); - else - { - XF_CHK_API(xaf_comp_process(NULL, p_comp, NULL, 0, XAF_INPUT_OVER_FLAG)); - input_over = 1; - } - } - - if (comp_status == XAF_OUTPUT_READY) - { - void *p_buf = (void *) comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(consume_output(p_buf, size, p_output)); - XF_CHK_API(xaf_comp_process(NULL, p_comp, (void *)comp_info.buf, comp_info.length, XAF_NEED_OUTPUT_FLAG)); - } - } - pthread_exit(pg_pthread_exit_code); - - return 0; -} - -int main(int argc, const char **argv) -{ - void *p_adev = NULL; - void *p_decoder[MAX_INP_STRMS]; - void *p_mixer; - mem_obj_t* mem_handle; - int num_comp = NUM_COMP_IN_GRAPH; - - xaf_comp_status dec_status; - xaf_info_t comp_info; - - void *p_input[MAX_INP_STRMS], *p_output; - - xf_id_t dec_id[MAX_INP_STRMS]; - int (*dec_setup[MAX_INP_STRMS])(void *p_comp); - - pthread_t dec_thread[MAX_INP_STRMS]; - pthread_t mixer_thread; - void *dec_thread_args[MAX_INP_STRMS][3]; - void *mixer_thread_args[3]; - - const char *ext; - FILE *fp, *ofp; - void *dec_inbuf[MAX_INP_STRMS][2]; - int buf_length = XAF_INBUF_SIZE; - int read_length; - int input_over = 0; - int i, j; - int num_strms; - - unsigned int card = 0; - unsigned int device = 0; - unsigned int period_size = 1024; - unsigned int period_count = 4; - - int pthread_error; - void *pthread_exit_code[3]; - - struct sigaction actions; - memset(&actions, 0, sizeof(actions)); - sigemptyset(&actions.sa_mask); - actions.sa_flags = 0; - actions.sa_handler = thread_exit_handler; - sigaction(SIGUSR1,&actions,NULL); - - /* ...initialize playback format */ - pb_format.sample_rate = 48000; - pb_format.channels = 2; - pb_format.pcm_width = 16; - - audio_frmwk_buf_size = 0; //unused - audio_comp_buf_size = 0; //unused - - print_banner("\'Audio decoder(PCM/Ogg-Vorbis) + Mixer\'"); - - /* ...initialize tracing facility */ - TRACE_INIT("Xtensa Audio Framework - Sample Application"); - -#if !defined BOARD - /* ...check input arguments */ - if (argc < 2 || argc > (MAX_INP_STRMS+1)) - { - TRACE(ERROR, _b("Usage: ./xaf-test <infile1> <infile2>\n")); - PRINT_USAGE; - return 0; - } - - argc--; - for (i=0; i<argc; i++) - { - ext = strrchr(argv[i+1], '.'); - if (!ext) - { - PRINT_USAGE; - return 0; - } - ext++; - if (!strcmp(ext, "pcm")) { - dec_id[i] = "audio-decoder/pcm"; - dec_setup[i] = pcm_setup; - } - else if (!strcmp(ext, "ogg")) { - dec_id[i] = "audio-decoder/vorbis"; - dec_setup[i] = vorbis_setup; - } - else { - TRACE(ERROR, _x("Unknown Decoder Extension '%s'"), ext); - PRINT_USAGE; - exit(-1); - } - /* ...open file */ - if ((fp = fopen(argv[i+1], "rb")) == NULL) - { - TRACE(ERROR, _x("Failed to open '%s': %d"), argv[i+1], errno); - exit(-1); - } - p_input[i] = fp; - } - num_strms = i; - - if ((ofp = fopen("dec-mix-out.pcm", "wb")) == NULL) - { - TRACE(ERROR, _x("Failed to open '%s': %d"), "dec-mix-out.pcm", errno); - exit(-1); - } - p_output = ofp; -#endif - - mem_handle = mem_init(); //initialize memory handler - - XF_CHK_API(xaf_adev_open(&p_adev, audio_frmwk_buf_size, audio_comp_buf_size, mem_malloc, mem_free)); - - /* ...create mixer component */ - XF_CHK_API(xaf_comp_create(p_adev, &p_mixer, "mixer", 0, 1, NULL, XAF_MIXER)); - XF_CHK_API(mixer_setup(p_mixer, &pb_format)); - - for (i=0; i<num_strms; i++) - { - /* ...create decoder component */ - XF_CHK_API(xaf_comp_create(p_adev, &p_decoder[i], dec_id[i], 2, 0, &dec_inbuf[i][0], XAF_DECODER)); - XF_CHK_API((dec_setup[i])(p_decoder[i])); - - /* ...start decoder component */ - XF_CHK_API(xaf_comp_process(p_adev, p_decoder[i], NULL, 0, XAF_START_FLAG)); - - /* ...feed input to decoder component */ - for (j=0; j<2; j++) - { - XF_CHK_API(read_input(dec_inbuf[i][j], buf_length, &read_length, p_input[i])); - - if (read_length) - XF_CHK_API(xaf_comp_process(p_adev, p_decoder[i], dec_inbuf[i][j], read_length, XAF_INPUT_READY_FLAG)); - else - break; - } - - /* ...initialization loop */ - while (1) - { - XF_CHK_API(xaf_comp_get_status(p_adev, p_decoder[i], &dec_status, &comp_info)); - - if (dec_status == XAF_INIT_DONE || dec_status == XAF_EXEC_DONE) break; - - if (dec_status == XAF_NEED_INPUT && !input_over) - { - void *p_buf = (void *) comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(read_input(p_buf, size, &read_length, p_input[i])); - - if (read_length) - XF_CHK_API(xaf_comp_process(p_adev, p_decoder[i], p_buf, read_length, XAF_INPUT_READY_FLAG)); - else - break; - } - } - - if (dec_status != XAF_INIT_DONE) - { - TRACE(ERROR, _x("Failed to init")); - exit(-1); - } - - XF_CHK_API(xaf_connect(p_decoder[i], p_mixer, 4)); - } - - XF_CHK_API(xaf_comp_process(p_adev, p_mixer, NULL, 0, XAF_START_FLAG)); - XF_CHK_API(xaf_comp_get_status(p_adev, p_mixer, &dec_status, &comp_info)); - - if (dec_status != XAF_INIT_DONE) - { - TRACE(ERROR, _x("Failed to init")); - exit(-1); - } - - /* ...open playback device */ - pb_handle = xa_playback_open(card, device, pb_format.channels, pb_format.sample_rate, - pb_format.pcm_width, period_size, period_count); - if (!pb_handle) { - TRACE(ERROR, _x("Playback open error\n")); - return -1; - } - - for (i=0; i<num_strms; i++) - { - dec_thread_args[i][0] = p_decoder[i]; - dec_thread_args[i][1] = p_input[i]; - dec_thread_args[i][2] = p_output; - pthread_create(&dec_thread[i], 0, (void *(*)(void*))&comp_process_entry, dec_thread_args[i]); - } - - mixer_thread_args[0] = p_mixer; - mixer_thread_args[1] = NULL; - mixer_thread_args[2] = p_output; - pthread_create(&mixer_thread, 0, (void *(*)(void*))comp_process_entry, &mixer_thread_args[0]); - - for (i=0; i<num_strms; i++) - { - pthread_error = pthread_join(dec_thread[i], (void **) &pthread_exit_code[i]); - if(pthread_error) - { - TRACE(ERROR, _b("decode thread %d join error:%x\n"), i, pthread_error); - } - } - pthread_error = pthread_join(mixer_thread, (void **) &pthread_exit_code[i]); - if(pthread_error) - { - TRACE(ERROR, _b("mixer thread join error:%x\n"), pthread_error); - } - - for (i=0; i<num_strms; i++) - { - XF_CHK_API(xaf_comp_delete(p_decoder[i])); - if (p_input[i]) fclose(p_input[i]); - } - XF_CHK_API(xaf_comp_delete(p_mixer)); - - /* ...exec done, clean-up */ - xa_playback_close(pb_handle); - - XF_CHK_API(xaf_adev_close(p_adev, 0 /*unused*/)); - if (p_output) fclose(p_output); - - mem_exit(); - XF_CHK_API(print_mem_mcps_info(mem_handle, num_comp)); - - return 0; -} - diff --git a/hifi/xaf/host-apf/utest/xaf-dec-test.c b/hifi/xaf/host-apf/utest/xaf-dec-test.c deleted file mode 100644 index b83a0f90..00000000 --- a/hifi/xaf/host-apf/utest/xaf-dec-test.c +++ /dev/null @@ -1,344 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -#define MODULE_TAG UTEST - -#include "xaf-utils-test.h" - -#include "audio/xa_vorbis_dec_api.h" -#include "audio/xa-audio-decoder-api.h" - -#include "xa_playback.h" - -#define PRINT_USAGE do { fprintf(stderr, "\nUsage: %s <input-file>\n", argv[0]); \ - fprintf(stderr, " Only .ogg and .pcm files are supported. \n"); \ - fprintf(stderr, " Playback is configured @ 48kHz, 2 ch, 16 bits pcm. \n"); \ - fprintf(stderr, " pcm output is written to dec-out.pcm, by default. \n\n"); \ - } while(0) - - -#define NUM_COMP_IN_GRAPH 1 - -void *p_input, *p_output; -pthread_t dec_thread; - -FILE *fp, *ofp=NULL; -xaf_info_t comp_info; -void *pb_handle = NULL; -unsigned int card = 0; -unsigned int device = 0; -unsigned int period_size = 1024; -unsigned int period_count = 4; - -/* ...playback format */ -xaf_format_t pb_format; - -int g_pthread_exit_code=0x12345678; - -void thread_exit_handler(int sig) -{ - /* ...unused arg */ - (void) sig; - - pthread_exit(0); -} - -static int vorbis_setup(void *p_decoder) -{ - int param[2]; - - /* 1: Raw decode, 0: Ogg decode */ - param[0] = XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_FILE_MODE; - param[1] = 0; - - XF_CHK_API(xaf_comp_set_config(p_decoder, 1, ¶m[0])); - - return 0; -} - -static int pcm_setup(void *p_pcm) -{ - int param[6]; - - param[0] = XA_CODEC_CONFIG_PARAM_SAMPLE_RATE; - param[1] = pb_format.sample_rate; - param[2] = XA_CODEC_CONFIG_PARAM_CHANNELS; - param[3] = pb_format.channels; - param[4] = XA_CODEC_CONFIG_PARAM_PCM_WIDTH; - param[5] = pb_format.pcm_width; - - XF_CHK_API(xaf_comp_set_config(p_pcm, 3, ¶m[0])); - - return 0; -} - -static int consume_output(void *p_buf, int buf_length, void *p_output) -{ - XAF_CHK_PTR(p_buf); - XAF_CHK_PTR(p_output); - -#if !defined BOARD - FILE *fp = p_output; - fwrite(p_buf, 1, buf_length, fp); - - if (xa_playback_buf(pb_handle, p_buf, buf_length)) { - TRACE(ERROR, _b("Playback Failed \n")); - return -1; - } -#else -#endif - return 0; -} - -static int read_input(void *p_buf, int buf_length, int *read_length, void *p_input) -{ - XAF_CHK_PTR(p_buf); - XAF_CHK_PTR(read_length); - XAF_CHK_PTR(p_input); - -#if !defined BOARD - FILE *fp = p_input; - *read_length = fread(p_buf, 1, buf_length, fp); -#else -#endif - return 0; -} - -static int comp_process_entry(void *arg) -{ - void *p_comp; - xaf_comp_status comp_status; - int input_over, read_length; - void *pg_pthread_exit_code = (void*)&g_pthread_exit_code; - - XAF_CHK_PTR(arg); - XAF_CHK_PTR(p_input); - XAF_CHK_PTR(p_output); - - p_comp = arg; - input_over = 0; - - XF_CHK_API(xaf_comp_process(NULL, p_comp, NULL, 0, XAF_EXEC_FLAG)); - - while (1) - { - - XF_CHK_API(xaf_comp_get_status(NULL, p_comp, &comp_status, &comp_info)); - - if (comp_status == XAF_EXEC_DONE) break; - - if (comp_status == XAF_NEED_INPUT && !input_over) - { - void *p_buf = (void *)comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(read_input(p_buf, size, &read_length, p_input)); - - if (read_length) - XF_CHK_API(xaf_comp_process(NULL, p_comp, (void *)comp_info.buf, read_length, XAF_INPUT_READY_FLAG)); - else - { - XF_CHK_API(xaf_comp_process(NULL, p_comp, NULL, 0, XAF_INPUT_OVER_FLAG)); - input_over = 1; - } - } - - if (comp_status == XAF_OUTPUT_READY) - { - void *p_buf = (void *)comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(consume_output(p_buf, size, p_output)); - XF_CHK_API(xaf_comp_process(NULL, p_comp, (void *)comp_info.buf, comp_info.length, XAF_NEED_OUTPUT_FLAG)); - } - } - pthread_exit(pg_pthread_exit_code); - - return 0; -} - - -int main(int argc, const char **argv) -{ - void *p_adev = NULL; - void *p_decoder; - mem_obj_t* mem_handle; - int num_comp = NUM_COMP_IN_GRAPH; - - xaf_comp_status dec_status; - void *dec_inbuf[2]; - int buf_length = XAF_INBUF_SIZE; - int read_length; - int i; - - xf_id_t dec_id; - int (*dec_setup)(void *p_comp); - const char *ext; - int pthread_error; - void *pthread_exit_code; - - struct sigaction actions; - memset(&actions, 0, sizeof(actions)); - sigemptyset(&actions.sa_mask); - actions.sa_flags = 0; - actions.sa_handler = thread_exit_handler; - sigaction(SIGUSR1,&actions,NULL); - - /* ...initialize playback format */ - pb_format.sample_rate = 48000; - pb_format.channels = 2; - pb_format.pcm_width = 16; - - audio_frmwk_buf_size = 0; //unused - audio_comp_buf_size = 0; //unused - - print_banner("\'Audio decoder(PCM/Ogg-Vorbis)\'"); - - /* ...initialize tracing facility */ - TRACE_INIT("Xtensa Audio Framework - Sample Application"); - -#if !defined BOARD - /* ...check input arguments */ - if (argc != 2) - { - TRACE(ERROR, _b("Usage: ./xaf-test <input-file-.ogg/.pcm>\n")); - PRINT_USAGE; - return 0; - } - - - ext = strrchr(argv[1], '.'); - if (!ext) - { - PRINT_USAGE; - return 0; - } - ext++; - if (!strcmp(ext, "pcm")) { - dec_id = "audio-decoder/pcm"; - dec_setup = pcm_setup; - } - else if (!strcmp(ext, "ogg")) { - dec_id = "audio-decoder/vorbis"; - dec_setup = vorbis_setup; - } - else { - TRACE(ERROR, _x("Unknown Decoder Extension '%s'"), ext); - PRINT_USAGE; - exit(-1); - } - - /* ...open file */ - if ((fp = fopen(argv[1], "rb")) == NULL) - { - TRACE(ERROR, _x("Failed to open '%s': %d"), argv[1], errno); - exit(-1); - } - if ((ofp = fopen("/data/dec-out.pcm", "wb")) == NULL) - { - TRACE(ERROR, _x("Failed to open '%s': %d"), "/data/dec-out.pcm", errno); - exit(-1); - } - p_input = fp; - p_output = ofp; -#endif - - mem_handle = mem_init(); //initialize memory handler - - XF_CHK_API(xaf_adev_open(&p_adev, audio_frmwk_buf_size, audio_comp_buf_size, mem_malloc, mem_free)); - - /* ...create decoder component */ - XF_CHK_API(xaf_comp_create(p_adev, &p_decoder, dec_id, 2, 1, &dec_inbuf[0], XAF_DECODER)); - XF_CHK_API(dec_setup(p_decoder)); - - /* ...start decoder component */ - XF_CHK_API(xaf_comp_process(p_adev, p_decoder, NULL, 0, XAF_START_FLAG)); - - /* ...feed input to decoder component */ - for (i=0; i<2; i++) - { - XF_CHK_API(read_input(dec_inbuf[i], buf_length, &read_length, p_input)); - - if (read_length) - XF_CHK_API(xaf_comp_process(p_adev, p_decoder, dec_inbuf[i], read_length, XAF_INPUT_READY_FLAG)); - else - break; - } - - /* ...initialization loop */ - while (1) - { - XF_CHK_API(xaf_comp_get_status(p_adev, p_decoder, &dec_status, &comp_info)); - - if (dec_status == XAF_INIT_DONE || dec_status == XAF_EXEC_DONE) - { - pb_handle = xa_playback_open(card, device, pb_format.channels, pb_format.sample_rate, - pb_format.pcm_width, period_size, period_count); - if (!pb_handle) { - TRACE(ERROR, _x("Playback open error\n")); - return -1; - } - - break; - } - - if (dec_status == XAF_NEED_INPUT) - { - void *p_buf = (void *) comp_info.buf; - int size = comp_info.length; - - XF_CHK_API(read_input(p_buf, size, &read_length, p_input)); - - if (read_length) - XF_CHK_API(xaf_comp_process(p_adev, p_decoder, p_buf, read_length, XAF_INPUT_READY_FLAG)); - else - break; - } - } - - if (dec_status != XAF_INIT_DONE) - { - TRACE(ERROR, _x("Failed to init")); - exit(-1); - } - - pthread_create(&dec_thread, 0, (void *(*)(void *))&comp_process_entry, p_decoder); - - pthread_error = pthread_join(dec_thread, (void **) &pthread_exit_code); - if(pthread_error) - { - TRACE(ERROR, _b("decode thread join error:%x\n"), pthread_error); - } - - /* ...exec done, clean-up */ - XF_CHK_API(xaf_comp_delete(p_decoder)); - xa_playback_close(pb_handle); - XF_CHK_API(xaf_adev_close(p_adev, 0 /*unused*/)); - if (fp) fclose(fp); - if (ofp) fclose(ofp); - - mem_exit(); - XF_CHK_API(print_mem_mcps_info(mem_handle, num_comp)); - - return 0; -} - diff --git a/hifi/xaf/host-apf/utest/xaf-mem-test.c b/hifi/xaf/host-apf/utest/xaf-mem-test.c deleted file mode 100644 index 1343c904..00000000 --- a/hifi/xaf/host-apf/utest/xaf-mem-test.c +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -#include <stdio.h> -#include <stdlib.h> - -#include "xa_type_def.h" - -/* ...debugging facility */ -#include "xaf-utils-test.h" - -mem_obj_t g_mem_obj; - -void* mem_malloc(int size, int id) -{ - int index; - void* heap_ptr = NULL; - - if(id == XAF_MEM_ID_DEV) - { - index = g_mem_obj.num_malloc_dev; - if(index >= MEM_NUM_MEM_ALLOC-1) - { - heap_ptr = NULL; - } - else - { - heap_ptr = malloc(size); - g_mem_obj.num_malloc_dev++; - g_mem_obj.mem_dev[index].heap_ptr = heap_ptr; - g_mem_obj.mem_dev[index].size = size; - g_mem_obj.persi_mem_dev += size; - } - } - else if(id == XAF_MEM_ID_COMP) - { - index = g_mem_obj.num_malloc_comp; - if(index >= MEM_NUM_MEM_ALLOC-1) - { - heap_ptr = NULL; - } - else - { - heap_ptr = malloc(size); - g_mem_obj.num_malloc_comp++; - g_mem_obj.mem_comp[index].heap_ptr = heap_ptr; - g_mem_obj.mem_comp[index].size = size; - g_mem_obj.persi_mem_comp += size; - } - } - return heap_ptr; -} - -int get_heap_ptr_index(void* p_heap, int id) -{ - int idx; - - idx = -1; - if(id == XAF_MEM_ID_DEV) - { - for(idx = 0; idx < MEM_NUM_MEM_ALLOC; idx++) - { - if(g_mem_obj.mem_dev[idx].heap_ptr == p_heap) - break; - } - } - - else if(id == XAF_MEM_ID_COMP) - { - for(idx = 0; idx < MEM_NUM_MEM_ALLOC; idx++) - { - if(g_mem_obj.mem_comp[idx].heap_ptr == p_heap) - break; - } - } - return idx; -} - -void mem_free(void * heap_ptr, int id) -{ - int index; - int size; - - index = get_heap_ptr_index(heap_ptr, id); - - if (index != -1) - { - if(id == XAF_MEM_ID_DEV) - { - size=g_mem_obj.mem_dev[index].size; - g_mem_obj.mem_dev[index].size = 0; - g_mem_obj.num_malloc_dev--; - free(heap_ptr); - g_mem_obj.mem_dev[index].heap_ptr = NULL; - } - else if(id == XAF_MEM_ID_COMP) - { - size=g_mem_obj.mem_comp[index].size; - g_mem_obj.mem_comp[index].size = 0; - g_mem_obj.num_malloc_comp--; - free(heap_ptr); - g_mem_obj.mem_comp[index].heap_ptr = NULL; - } - } - return; -} - -int mem_get_alloc_size(mem_obj_t* pmem_handle, int id) -{ - int mem_size = 0; - if(id == XAF_MEM_ID_DEV) - mem_size = pmem_handle->persi_mem_dev; - else if(id == XAF_MEM_ID_COMP) - mem_size = pmem_handle->persi_mem_comp; - return mem_size; -} - -void* mem_init() -{ - void* ptr; - ptr = &g_mem_obj; - return ptr; -} - -void mem_exit() -{ - if((g_mem_obj.num_malloc_dev != 0)||(g_mem_obj.num_malloc_comp != 0)) - { - fprintf(stdout,"Memory leaks\n"); - } - return; -} diff --git a/hifi/xaf/host-apf/utest/xaf-utils-test.c b/hifi/xaf/host-apf/utest/xaf-utils-test.c deleted file mode 100644 index 79c6710d..00000000 --- a/hifi/xaf/host-apf/utest/xaf-utils-test.c +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ -#include <stdio.h> -#include <string.h> - -#include "xaf-utils-test.h" - -int audio_frmwk_buf_size; -int audio_comp_buf_size; - -int print_banner(char *app_name) -{ - /* - XAF_CHK_PTR(ver_info[0], "print_verinfo"); - XAF_CHK_PTR(ver_info[1], "print_verinfo"); - XAF_CHK_PTR(ver_info[2], "print_verinfo"); - */ - - fprintf(stdout, "******************************************************************************\n"); - fprintf(stdout, "Cadence Audio Framework (Hosted) : %s \n",app_name); - fprintf(stdout, "Copyright (c) 2018 Cadence Design Systems, Inc.\n"); - /*fprintf(stdout, "Lib Name : %s\n", ver_info[0]); - fprintf(stdout, "Lib Version : %s\n", ver_info[1]); - fprintf(stdout, "API Version : %s\n", ver_info[2]);*/ - fprintf(stdout, "******************************************************************************\n"); - - return 0; -} - -int print_mem_mcps_info(mem_obj_t* mem_handle, int num_comp) -{ - int tot_dev_mem_size, tot_comp_mem_size, tot_size; - - /* ...unused arg */ - (void) num_comp; - - /* ...printing memory info*/ - - tot_dev_mem_size = mem_get_alloc_size(mem_handle, XAF_MEM_ID_DEV); - tot_comp_mem_size = mem_get_alloc_size(mem_handle, XAF_MEM_ID_COMP); - tot_size = tot_dev_mem_size + tot_comp_mem_size; - - fprintf(stdout,"Shared Memory between AP and DSP for IPC: %8d \n", XF_CFG_REMOTE_IPC_POOL_SIZE); - fprintf(stdout,"Memory allocated on AP for Device : %8d \n", tot_dev_mem_size); - fprintf(stdout,"Memory allocated on AP for Components : %8d \n", tot_comp_mem_size); - fprintf(stdout,"Memory allocated on DSP for Components : %8d \n", XF_CFG_LOCAL_POOL_SIZE); - - return 0; -} - diff --git a/hifi/xaf/release.txt b/hifi/xaf/release.txt deleted file mode 100755 index cebd1e24..00000000 --- a/hifi/xaf/release.txt +++ /dev/null @@ -1,24 +0,0 @@ -====================================================================== -Xtensa Audio Framework (XAF) - Hosted solution -====================================================================== - -====================================================================== -Revision History -====================================================================== - -Version 0.7_Alpha API 1.1 : April 17, 2018 - -+ Alpha Release -+ Built with RG.5 tools - -+ Added copyrights for makefiles and assembly files. -+ Added float-print (%f) support in DSP trace logs. - ----------------------------------------------------------------------- - -Version 0.6_Alpha API 1.1 : February 15, 2018 - -+ Alpha Release -+ Built with RG.5 tools - ----------------------------------------------------------------------- diff --git a/hikey-common.mk b/hikey-common.mk index a2cb4607..bf3bd24b 100644 --- a/hikey-common.mk +++ b/hikey-common.mk @@ -2,22 +2,13 @@ ifndef TARGET_KERNEL_USE TARGET_KERNEL_USE=4.19 endif -HIKEY_USE_DRM_HWCOMPOSER := false - -TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image.gz-dtb-$(TARGET_KERNEL_USE) - -TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hi6220-hikey.dtb-$(TARGET_KERNEL_USE) +LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE) +TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb +TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi6220-hikey.dtb PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE := true -ifeq ($(TARGET_KERNEL_USE), 4.4) - HIKEY_USE_LEGACY_TI_BLUETOOTH := true -else - HIKEY_USE_LEGACY_TI_BLUETOOTH := false - HIKEY_USE_DRM_HWCOMPOSER := true -endif TARGET_FSTAB := fstab.hikey $(call inherit-product, device/linaro/hikey/hikey/device-hikey.mk) $(call inherit-product, device/linaro/hikey/device-common.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) @@ -1,5 +1,7 @@ +include $(LOCAL_PATH)/vendor-package-ver.mk $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, device/linaro/hikey/hikey-common.mk) +$(call inherit-product-if-exists, vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/hikey.mk) #setup dm-verity configs PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/platform/soc/f723d000.dwmmc0/by-name/system @@ -15,7 +17,7 @@ PRODUCT_DEVICE := hikey PRODUCT_BRAND := Android ifneq ($(HIKEY_USES_GKI),) -HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey/5.4/ +HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME) HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko) ifneq ($(HIKEY_MODS),) BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS) @@ -27,23 +29,34 @@ ifneq ($(HIKEY_MODS),) $(HIKEY_MOD_DIR)/phy-hi6220-usb.ko # make sure ion cma heap loads early + CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/cma_heap*.ko) + ION_CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/ion_cma_heap*.ko) BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ - $(HIKEY_MOD_DIR)/ion_cma_heap.ko + $(CMA_HEAP_KO) \ + $(ION_CMA_HEAP_KO) # Not sure why, but powerkey has to be initrd # or else we'll see stalls or issues at bootup BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ $(HIKEY_MOD_DIR)/hisi_powerkey.ko + MMC_CORE_KO := $(wildcard $(HIKEY_MOD_DIR)/mmc_core.ko) + MMC_BLOCK_KO := $(wildcard $(HIKEY_MOD_DIR)/mmc_block.ko) + BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ + $(MMC_CORE_KO) \ + $(MMC_BLOCK_KO) + BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ $(HIKEY_MOD_DIR)/hi655x-regulator.ko \ $(HIKEY_MOD_DIR)/clk-hi655x.ko \ $(HIKEY_MOD_DIR)/hi655x-pmic.ko \ - $(HIKEY_MOD_DIR)/mmc_core.ko \ - $(HIKEY_MOD_DIR)/mmc_block.ko \ $(HIKEY_MOD_DIR)/dw_mmc-k3.ko \ $(HIKEY_MOD_DIR)/dw_mmc-pltfm.ko \ $(HIKEY_MOD_DIR)/dw_mmc.ko \ endif endif + +PRODUCT_SOONG_NAMESPACES += \ + vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/mali/utgard + diff --git a/hikey/device-hikey.mk b/hikey/device-hikey.mk index 70680e55..cc94c401 100644 --- a/hikey/device-hikey.mk +++ b/hikey/device-hikey.mk @@ -20,19 +20,10 @@ PRODUCT_COPY_FILES += $(TARGET_PREBUILT_KERNEL):kernel \ device/linaro/hikey/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.hikey \ device/linaro/hikey/hikey/init.hikey.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey.rc \ device/linaro/hikey/init.hikey.power.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey.power.rc \ - device/linaro/hikey/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey.usb.rc \ + device/linaro/hikey/hikey/init.hikey.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey.usb.rc \ device/linaro/hikey/ueventd.common.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \ device/linaro/hikey/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/hikey.kl -# Copy BT firmware -PRODUCT_COPY_FILES += \ - device/linaro/hikey/bt-wifi-firmware-util/TIInit_11.8.32.bts:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/TIInit_11.8.32.bts - -# Copy wlan firmware -PRODUCT_COPY_FILES += \ - device/linaro/hikey/bt-wifi-firmware-util/wl18xx-fw-4.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/wl18xx-fw-4.bin \ - device/linaro/hikey/bt-wifi-firmware-util/wl18xx-conf.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/wl18xx-conf.bin - # Build HiKey HDMI audio HAL PRODUCT_PACKAGES += audio.primary.hikey @@ -51,12 +42,10 @@ PRODUCT_PACKAGES += power.hikey # Sensors HAL PRODUCT_PACKAGES += sensors.hikey -ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true) - PRODUCT_PACKAGES += hwcomposer.drm_hikey -endif +PRODUCT_PACKAGES += hwcomposer.drm_hikey # Include mali blobs from ARM -PRODUCT_PACKAGES += libGLES_mali.so END_USER_LICENCE_AGREEMENT.txt +PRODUCT_PACKAGES += libGLES_mali ifneq ($(TARGET_NO_RECOVERY),true) PRODUCT_COPY_FILES += \ diff --git a/hikey/fstab.hikey b/hikey/fstab.hikey index 2a5cd3cb..fbaf2c68 100644 --- a/hikey/fstab.hikey +++ b/hikey/fstab.hikey @@ -4,6 +4,6 @@ # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK /dev/block/platform/soc/f723d000.dwmmc0/by-name/userdata /data f2fs discard,noatime,nosuid,nodev wait,check,fileencryption=software,quota -/dev/block/platform/soc/f723d000.dwmmc0/by-name/userdata /data ext4 discard,noatime,noauto_da_alloc,nosuid,nodev,data=ordered,user_xattr,barrier=1 wait,formattable +/dev/block/platform/soc/f723d000.dwmmc0/by-name/userdata /data ext4 discard,noatime,noauto_da_alloc,nosuid,nodev,data=ordered,user_xattr,barrier=1 wait,formattable,quota /devices/platform/soc/f723e000.dwmmc1/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/platform/soc/f72c0000.usb/usb* auto auto defaults voldmanaged=usbdisk:auto,encryptable=userdata diff --git a/hikey/init.hikey.rc b/hikey/init.hikey.rc index 8046f91f..6ea3b3b3 100644 --- a/hikey/init.hikey.rc +++ b/hikey/init.hikey.rc @@ -1,5 +1,8 @@ import init.common.rc +on fs + mount_all /vendor/etc/fstab.${ro.hardware} + on post-fs # Set supported opengles version setprop ro.hardware.hwcomposer drm_hikey diff --git a/init.common.usb.rc b/hikey/init.hikey.usb.rc index 16054ba0..baffb125 100644 --- a/init.common.usb.rc +++ b/hikey/init.hikey.usb.rc @@ -27,6 +27,9 @@ on boot mkdir /dev/usb-ffs/ptp 0770 mtp mtp mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 + + setprop sys.usb.controller "f72c0000.usb" + setprop sys.usb.mtp.device_type 3 setprop sys.usb.configfs 1 setprop sys.usb.ffs.aio_compat 1 diff --git a/hikey960.mk b/hikey960.mk index 2e338e9a..3a58d251 100644 --- a/hikey960.mk +++ b/hikey960.mk @@ -1,34 +1,24 @@ ifndef TARGET_KERNEL_USE -TARGET_KERNEL_USE=4.19 +TARGET_KERNEL_USE=5.4 endif -TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image.gz-dtb-hikey960-$(TARGET_KERNEL_USE) -TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hi3660-hikey960.dtb-$(TARGET_KERNEL_USE) - -ifeq ($(TARGET_KERNEL_USE), 4.4) - HIKEY_USE_DRM_HWCOMPOSER := false - HIKEY_USE_LEGACY_TI_BLUETOOTH := true -else - ifeq ($(TARGET_KERNEL_USE), 4.9) - HIKEY_USE_DRM_HWCOMPOSER := false - else - HIKEY_USE_DRM_HWCOMPOSER := true +LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE) +TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb +TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb + +ifndef HIKEY_USES_GKI + ifeq ($(TARGET_KERNEL_USE), 5.4) + HIKEY_USES_GKI := true endif - HIKEY_USE_LEGACY_TI_BLUETOOTH := false endif -# -# Inherit the full_base and device configurations + +include $(LOCAL_PATH)/vendor-package-ver.mk + +# Inherit the common device configuration $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk) $(call inherit-product, device/linaro/hikey/device-common.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) - -#setup dm-verity configs -PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/platform/soc/ff3b0000.ufs/by-name/system -PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/platform/soc/ff3b0000.ufs/by-name/vendor -$(call inherit-product, build/target/product/verity.mk) -PRODUCT_SUPPORTS_BOOT_SIGNER := false -PRODUCT_SUPPORTS_VERITY_FEC := false +$(call inherit-product-if-exists, vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/hikey960.mk) PRODUCT_PROPERTY_OVERRIDES += ro.opengles.version=196608 @@ -40,12 +30,25 @@ PRODUCT_BRAND := Android PRODUCT_MODEL := AOSP on hikey960 ifneq ($(HIKEY_USES_GKI),) - HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE) + HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME) HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko) + SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko) + CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/cma_heap.ko) + DEFERRED_FREE_KO := $(wildcard $(HIKEY_MOD_DIR)/deferred-free-helper.ko) + PAGE_POOL_KO := $(wildcard $(HIKEY_MOD_DIR)/page_pool.ko) + SYSTEM_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/system_heap.ko) + ION_CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/ion_cma_heap*.ko) ifneq ($(HIKEY_MODS),) BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS) BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ - $(HIKEY_MOD_DIR)/ion_cma_heap.ko \ - $(HIKEY_MOD_DIR)/ufs-hisi.ko + $(CMA_HEAP_KO) \ + $(SYSTEM_HEAP_KO) \ + $(DEFERRED_FREE_KO) \ + $(PAGE_POOL_KO) \ + $(ION_CMA_HEAP_KO) \ + $(SDCARDFS_KO) endif endif + +PRODUCT_SOONG_NAMESPACES += \ + vendor/linaro/hikey960/$(EXPECTED_LINARO_VENDOR_VERSION)/mali/bifrost diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk index 3cd7a632..f7deb4c1 100644 --- a/hikey960/BoardConfig.mk +++ b/hikey960/BoardConfig.mk @@ -10,30 +10,12 @@ TARGET_NO_DTIMAGE := false BOARD_KERNEL_CMDLINE := androidboot.hardware=hikey960 firmware_class.path=/vendor/firmware efi=noruntime init=/init BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/ff3b0000.ufs -BOARD_KERNEL_CMDLINE += loglevel=15 +BOARD_KERNEL_CMDLINE += loglevel=15 androidboot.slot_suffix=_a ifeq ($(TARGET_BUILTIN_EDID), true) BOARD_KERNEL_CMDLINE += drm_kms_helper.edid_firmware=edid/1920x1080.bin endif -# On kernels before 4.19, enable dtb fstab. On kernels >= 4.19, both dtb -# fstab and android-verity are deprecated, so until we have avb2 support -# in the bootloader, don't enable either feature. The ramdisk fstab -# needed for the new mechanism will be installed unconditionally; if dtb -# fstab is present, it will override it automatically. -ifneq ($(TARGET_KERNEL_USE),4.19) -# Enable treble dtb fstab with verity -ifneq ($(TARGET_ANDROID_VERITY),) -BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab_v2 -BOARD_KERNEL_CMDLINE += rootwait ro root=/dev/dm-0 -BOARD_KERNEL_CMDLINE += dm=\"system none ro,0 1 android-verity 8:58\" -BOARD_BUILD_SYSTEM_ROOT_IMAGE := true -else -# Enable treble dtb fstab without verity -BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab -endif -endif - ifneq ($(TARGET_SENSOR_MEZZANINE),) BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_$(TARGET_SENSOR_MEZZANINE) endif @@ -41,15 +23,26 @@ endif BOARD_MKBOOTIMG_ARGS := --base 0x0 --tags_offset 0x07a00000 --kernel_offset 0x00080000 --ramdisk_offset 0x07c00000 BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4915724288 # 4688MB BOARD_USERDATAIMAGE_PARTITION_SIZE := 25845301248 # 24648MB BOARD_FLASH_BLOCK_SIZE := 512 -# Vendor partition definitions +# Vendor/system_ext/product partition definitions TARGET_COPY_OUT_VENDOR := vendor -BOARD_VENDORIMAGE_PARTITION_SIZE := 822083584 # 784MB BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 -BOARD_VENDORIMAGE_JOURNAL_SIZE := 0 -BOARD_VENDORIMAGE_EXTFS_INODE_COUNT := 2048 +TARGET_COPY_OUT_SYSTEM_EXT := system_ext +BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_COPY_OUT_PRODUCT := product +BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_USES_METADATA_PARTITION := true + +#Dynamic Partition details +TARGET_USE_DYNAMIC_PARTITIONS := true +BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true +BOARD_SUPER_PARTITION_SIZE := 4915724288 +BOARD_SUPER_PARTITION_GROUPS := hikey960_dynamic_partitions +BOARD_HIKEY960_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext product +BOARD_HIKEY960_DYNAMIC_PARTITIONS_SIZE := 4911529984 # Reserve 4M for DAP metadata +BOARD_SUPER_PARTITION_METADATA_DEVICE := super +BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true TARGET_RECOVERY_FSTAB := device/linaro/hikey/hikey960/fstab.hikey960 diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk index 9bde93b8..fba39a48 100644 --- a/hikey960/device-hikey960.mk +++ b/hikey960/device-hikey960.mk @@ -14,33 +14,33 @@ # limitations under the License. # +# Enable Virtual A/B +AB_OTA_UPDATER := true +AB_OTA_PARTITIONS += \ + product \ + system \ + system_ext \ + vendor + +$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk) + PRODUCT_COPY_FILES += $(TARGET_PREBUILT_KERNEL):kernel \ $(TARGET_PREBUILT_DTB):hi3660-hikey960.dtb PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.hikey960:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.hikey960 \ - device/linaro/hikey/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.hikey960 \ + $(LOCAL_PATH)/fstab.hikey960:$(TARGET_COPY_OUT_RAMDISK)/fstab.hikey960 \ device/linaro/hikey/hikey960/init.hikey960.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.rc \ device/linaro/hikey/init.hikey960.power.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.power.rc \ - device/linaro/hikey/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.usb.rc \ + device/linaro/hikey/hikey960/init.hikey960.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.usb.rc \ device/linaro/hikey/ueventd.common.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \ device/linaro/hikey/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/hikey960.kl \ frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ - frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml - -# Copy BT firmware -PRODUCT_COPY_FILES += \ - device/linaro/hikey/bt-wifi-firmware-util/TIInit_11.8.32-pcm-960.bts:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/TIInit_11.8.32.bts - -# Copy wlan firmware -PRODUCT_COPY_FILES += \ - device/linaro/hikey/bt-wifi-firmware-util/wl18xx-fw-4.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/wl18xx-fw-4.bin \ - device/linaro/hikey/bt-wifi-firmware-util/wl18xx-conf-wl1837mod.bin:$(TARGET_COPY_OUT_VENDOR)/firmware/ti-connectivity/wl18xx-conf.bin - -# Copy hifi firmware -PRODUCT_COPY_FILES += \ - device/linaro/hikey/hifi/firmware/hifi-hikey960.img:$(TARGET_COPY_OUT_VENDOR)/firmware/hifi/hifi.img \ - device/linaro/hikey/hifi/xaf/host-apf/tools/dhifimesg:/vendor/bin/dhifimesg + frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ + frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml +PRODUCT_BUILD_SUPER_PARTITION := true +PRODUCT_USE_DYNAMIC_PARTITIONS := true +PRODUCT_USE_DYNAMIC_PARTITION_SIZE :=true # Build HiKey960 HDMI audio HAL. Experimental only may not work. FIXME PRODUCT_PACKAGES += audio.primary.hikey960 @@ -48,14 +48,13 @@ PRODUCT_PACKAGES += audio.primary.hikey960 PRODUCT_PACKAGES += gralloc.hikey960 #binary blobs from ARM -PRODUCT_PACKAGES += libGLES_mali.so \ - vulkan.hikey960.so \ - libbccArm.so \ - libRSDriverArm.so \ - libmalicore.bc \ - END_USER_LICENCE_AGREEMENT.txt +PRODUCT_PACKAGES += libGLES_mali \ + vulkan.hikey960 \ + libbccArm \ + libRSDriverArm \ + libmalicore.bc -ifdef $(MALI_RS_DRIVER_AVAILABLE) +ifdef MALI_RS_DRIVER_AVAILABLE PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/../mali/bifrost/lib/libclcore.bc:vendor/lib/libclcore.bc \ $(LOCAL_PATH)/../mali/bifrost/lib/libclcore_neon.bc:vendor/lib/libclcore_neon.bc \ @@ -75,25 +74,7 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += sys.usb.controller=ff100000.dwc3 PRODUCT_PACKAGES += sensors.hikey960 -ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true) - PRODUCT_PACKAGES += hwcomposer.drm_hikey960 -endif - -# Unfortunately inherit-product doesn't export build variables from the -# called make file to the caller, so we have to include it directly here. -# FIXME: Improve this the next time we update the binary package -ifneq (,$(wildcard vendor/linaro/hikey960/hisilicon/device-partial.mk)) -include vendor/linaro/hikey960/hisilicon/device-partial.mk -endif - -EXPECTED_HISI_CODEC_VERSION := 1 -# Check and make sure the vendor package is the expected version -ifneq ($(TARGET_HISI_CODEC_VERSION),$(EXPECTED_HISI_CODEC_VERSION)) -$(warning TARGET_HISI_CODEC_VERSION ($(TARGET_HISI_CODEC_VERSION)) does not match exiting the build ($(EXPECTED_HISI_CODEC_VERSION)).) -$(warning Please download new binaries here:) -$(warning https://dl.google.com/dl/android/aosp/hisilicon-hikey960-OPR-3c243263.tgz ) -$(warning And extract in the ANDROID_TOP_DIR) -endif +PRODUCT_PACKAGES += hwcomposer.drm_hikey960 ifneq ($(TARGET_NO_RECOVERY),true) PRODUCT_COPY_FILES += \ diff --git a/hikey960/fstab.hikey960 b/hikey960/fstab.hikey960 index 2bb2bbe8..ae250da1 100644 --- a/hikey960/fstab.hikey960 +++ b/hikey960/fstab.hikey960 @@ -6,8 +6,12 @@ #/dev/block/platform/soc/ff3b0000.ufs/by-name/system_a /system ext4 ro wait #/dev/block/platform/soc/ff3b0000.ufs/by-name/cache /cache ext4 discard,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait #/dev/block/platform/soc/ff3b0000.ufs/by-name/userdata /data ext4 discard,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait -/dev/block/by-name/userdata /data f2fs discard,noatime,nosuid,nodev wait,check,fileencryption=software,quota -/dev/block/by-name/userdata /data ext4 discard,noatime,nosuid,nodev,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait,formattable +/dev/block/by-name/userdata /data ext4 discard,noatime,nosuid,nodev,noauto_da_alloc,data=ordered,user_xattr,barrier=1 latemount,wait,formattable,fileencryption=aes-256-xts,keydirectory=/metadata/vold/metadata_encryption,quota +/dev/block/by-name/cache /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount,check /devices/platform/soc/ff37f000.dwmmc1/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/platform/soc/ff200000.hisi_usb/ff100000.dwc3/xhci-hcd.*.auto/usb* auto auto defaults voldmanaged=usbdisk:auto,encryptable=userdata /devices/platform/soc/f4000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/nvme/nvme* auto auto defaults voldmanaged=nvmedisk:auto,encryptable=userdata +system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect diff --git a/hikey960/init.hikey960.rc b/hikey960/init.hikey960.rc index b7671340..92c1385e 100644 --- a/hikey960/init.hikey960.rc +++ b/hikey960/init.hikey960.rc @@ -1,6 +1,12 @@ import init.common.rc +on fs + mount_all /vendor/etc/fstab.${ro.hardware} --early + on post-fs # Set supported opengles version setprop ro.hardware.hwcomposer drm_hikey960 +on late-fs + mount_all /vendor/etc/fstab.${ro.hardware} --late + diff --git a/hikey960/init.hikey960.usb.rc b/hikey960/init.hikey960.usb.rc new file mode 100644 index 00000000..bf9e0a46 --- /dev/null +++ b/hikey960/init.hikey960.usb.rc @@ -0,0 +1,92 @@ +on boot + mount configfs none /config + mkdir /config/usb_gadget/g1 0770 shell shell + mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell + write /config/usb_gadget/g1/bcdUSB 0x0200 + write /config/usb_gadget/g1/driver_match_existing_only 0 + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/bcdDevice 0x0223 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g1/strings/0x409/manufacturer "HISILICON" + write /config/usb_gadget/g1/strings/0x409/product "ADB Gadget" + mkdir /config/usb_gadget/g1/functions/accessory.gs2 + mkdir /config/usb_gadget/g1/functions/audio_source.gs3 + mkdir /config/usb_gadget/g1/functions/midi.gs5 + mkdir /config/usb_gadget/g1/functions/ffs.adb + mkdir /config/usb_gadget/g1/functions/ffs.mtp + mkdir /config/usb_gadget/g1/functions/ffs.ptp + mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell + write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 + write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" + write /config/usb_gadget/g1/configs/b.1/MaxPower 500 + mkdir /dev/usb-ffs 0775 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + mkdir /dev/usb-ffs/mtp 0770 mtp mtp + mkdir /dev/usb-ffs/ptp 0770 mtp mtp + mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 + mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 + + setprop sys.usb.controller "ff100000.dwc3" + + setprop sys.usb.mtp.device_type 3 + setprop sys.usb.configfs 1 + setprop sys.usb.ffs.aio_compat 1 + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/os_desc/use 0 + +on property:sys.usb.config=mtp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee1 + write /config/usb_gadget/g1/os_desc/use 1 + symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee2 + write /config/usb_gadget/g1/os_desc/use 1 + symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1 + +on property:sys.usb.config=rndis && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee3 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee4 + +on property:sys.usb.config=ptp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee5 + write /config/usb_gadget/g1/os_desc/use 1 + symlink /config/usb_gadget/g1/functions/ffs.ptp /config/usb_gadget/g1/configs/b.1/f1 + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee6 + write /config/usb_gadget/g1/os_desc/use 1 + symlink /config/usb_gadget/g1/functions/ffs.ptp /config/usb_gadget/g1/configs/b.1/f1 + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee7 + +on property:sys.usb.config=midi && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee8 + +on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee9 + +on property:sys.usb.config=accessory && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d00 + +on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d01 + +on property:sys.usb.config=audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d02 + +on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d03 + +on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d04 + +on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d05 diff --git a/init.common.rc b/init.common.rc index 1ae164b7..e864a645 100644 --- a/init.common.rc +++ b/init.common.rc @@ -16,8 +16,10 @@ on init start watchdogd +on early-fs + start vold + on fs - mount_all /vendor/etc/fstab.${ro.hardware} setprop ro.crypto.fuse_sdcard false on post-fs @@ -113,3 +115,9 @@ service bugreport /system/bin/dumpstate -d -p -z class main disabled oneshot + +# TODO: disable this service once we implement system suspend +service suspend_blocker /vendor/bin/suspend_blocker + class early_hal # Start together with system_suspend HAL + group system + user root diff --git a/installer/hikey/README b/installer/hikey/README deleted file mode 100644 index b58cd96a..00000000 --- a/installer/hikey/README +++ /dev/null @@ -1,38 +0,0 @@ -These instruction should help you in flashing the bootloader -and AOSP images built from sources. -Detailed instructions on how to setup the Board can be found -here: -https://github.com/96boards/documentation/wiki/HiKeyGettingStarted - -For flashing the bootloader, the top two links should be installed -(closed) and the 3rd link should be removed (open): - ---------------------------------------------------------- -| Name | Link | State | -| Auto Power up | Link 1-2 | closed | -| Boot Select | Link 3-4 | closed | -| GPIO3-1 | Link 5-6 | open | ---------------------------------------------------------- - -Link 1-2 causes HiKey to auto-power up when power is installed. Link -3-4 causes the HiKey SoC internal ROM to start up in at a special -"install bootloader" mode which will install a supplied bootloader -from the microUSB OTG port into RAM, and will present itself to a -connected PC as a ttyUSB device. - -Note: The HiKey board will remain in USB load mode for 90 seconds -from power up. If you take longer than 90 seconds to start the install -then power cycle the board before trying again. - -Wait about 5 seconds and then check that the HiKey board has been -recognized by your Linux PC: -$ ls /dev/ttyUSB* -or -$ dmesg - - -Run the flash-all.sh script after building AOSP for hikey with the right -right UART recognised in the above command: -$ ./flash-all.sh /dev/ttyUSBX [4g] - -Remove the link 3-4 and power on the board. diff --git a/installer/hikey/fip.bin b/installer/hikey/fip.bin Binary files differdeleted file mode 100644 index e388d9ec..00000000 --- a/installer/hikey/fip.bin +++ /dev/null diff --git a/installer/hikey/flash-all.sh b/installer/hikey/flash-all.sh deleted file mode 100755 index 4707d063..00000000 --- a/installer/hikey/flash-all.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -if [ $# -eq 0 ] - then - echo "Provide the right /dev/ttyUSBX specific to recovery device" - exit -fi - -if [ ! -e "${1}" ] - then - echo "device: ${1} does not exist" - exit -fi -DEVICE_PORT="${1}" -PTABLE=ptable-aosp-8g.img -if [ $# -gt 1 ] - then - if [ "${2}" == '4g' ] - then - PTABLE=ptable-aosp-4g.img - fi -fi - -INSTALLER_DIR="`dirname ${0}`" -FIRMWARE_DIR="${INSTALLER_DIR}" - -# for cases that not run "lunch hikey-userdebug" -if [ -z "${ANDROID_BUILD_TOP}" ]; then - ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ - ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey" -fi - -if [ -z "${DIST_DIR}" ]; then - DIST_DIR="${ANDROID_BUILD_TOP}"/out/dist -fi - -#get out directory path -while [ $# -ne 0 ]; do - case "${1}" in - --out) OUT_IMGDIR=${2};shift;; - --use-compiled-binaries) FIRMWARE_DIR="${DIST_DIR}";shift;; - esac - shift -done - -if [[ "${FIRMWARE_DIR}" == "${DIST_DIR}" && ! -e "${DIST_DIR}"/fip.bin && ! -e "${DIST_DIR}"/l-loader.bin ]]; then - echo "No binaries found at ${DIST_DIR}. Please build the bootloader first" - exit -fi - -if [ -z "${OUT_IMGDIR}" ]; then - if [ ! -z "${ANDROID_PRODUCT_OUT}" ]; then - OUT_IMGDIR="${ANDROID_PRODUCT_OUT}" - fi -fi - -if [ ! -d "${OUT_IMGDIR}" ]; then - echo "error in locating out directory, check if it exist" - exit -fi - -echo "android out dir:${OUT_IMGDIR}" - -sudo python "${INSTALLER_DIR}"/hisi-idt.py --img1="${FIRMWARE_DIR}"/l-loader.bin -d "${DEVICE_PORT}" -sleep 3 -# set a unique serial number -serialno=`fastboot getvar serialno 2>&1 > /dev/null` -if [ "${serialno:10:6}" == "(null)" ]; then - fastboot oem serialno -else - if [ "${serialno:10:15}" == "0123456789abcde" ]; then - fastboot oem serialno - fi -fi -fastboot getvar partition-size:ptable -fastboot flash ptable "${INSTALLER_DIR}"/"${PTABLE}" -fastboot flash fastboot "${FIRMWARE_DIR}"/fip.bin -fastboot flash nvme "${INSTALLER_DIR}"/nvme.img -fastboot flash boot "${OUT_IMGDIR}"/boot.img -fastboot flash system "${OUT_IMGDIR}"/system.img -fastboot flash vendor "${OUT_IMGDIR}"/vendor.img -fastboot flash userdata "${OUT_IMGDIR}"/userdata.img diff --git a/installer/hikey/hisi-idt.py b/installer/hikey/hisi-idt.py deleted file mode 100644 index db66ef88..00000000 --- a/installer/hikey/hisi-idt.py +++ /dev/null @@ -1,263 +0,0 @@ -#!/usr/bin/env python -#-*- coding: utf-8 -*- - -import os -import os.path - -import serial, time -import array -import sys, getopt - -class bootdownload(object): - ''' - Hisilicon boot downloader - - >>> downloader = bootdownload() - >>> downloader.download(filename) - - ''' - - # crctab calculated by Mark G. Mendel, Network Systems Corporation - crctable = [ - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, - ] - - startframe = { - 'hi3716cv200':[0xFE,0x00,0xFF,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x02,0x01] - } - - headframe = { - 'hi3716cv200':[0xFE,0x00,0xFF,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x02,0x01] - } - - bootheadaddress = { - 'hi3716cv200':0xF9800800 - } - - bootdownloadaddress = { - 'hi3716cv200':0x07000000 - } - - BOOT_HEAD_LEN = 0x4F00 - MAX_DATA_LEN = 0x400 - - def __init__(self,chiptype,serialport): - try: - self.s = serial.Serial(port=serialport, baudrate=115200, timeout=1) - except serial.serialutil.SerialException: - #no serial connection - self.s = None - print "\nFailed to open serial!", serialport - sys.exit(2) - - self.chip = chiptype - - def __del__(self): - if self.s != None: - self.s.close() - - def calc_crc(self, data, crc=0): - for char in data: - crc = ((crc << 8) | ord(char)) ^ self.crctable[(crc >> 8) & 0xff] - for i in range(0,2): - crc = ((crc << 8) | 0) ^ self.crctable[(crc >> 8) & 0xff] - return crc & 0xffff - - def getsize(self, filename): - st = os.stat(filename) - return st.st_size - - def sendframe(self, data, loop): - for i in range(1, loop): - self.s.flushOutput() - self.s.write(data) - self.s.flushInput() - try: - ack = self.s.read() - if len(ack) == 1: - if ack == chr(0xaa): - return None - except: - return None - - print 'failed' - - def sendstartframe(self): - self.s.timeout = 0.01 - data = array.array('B', self.startframe[self.chip]).tostring() - crc = self.calc_crc(data) - data += chr((crc >> 8)&0xff) - data += chr(crc&0xff) - self.sendframe(data,10000) - - def sendheadframe(self,length,address): - self.s.timeout = 0.03 - self.headframe[self.chip][4] = (length>>24)&0xff - self.headframe[self.chip][5] = (length>>16)&0xff - self.headframe[self.chip][6] = (length>>8)&0xff - self.headframe[self.chip][7] = (length)&0xff - self.headframe[self.chip][8] = (address>>24)&0xff - self.headframe[self.chip][9] = (address>>16)&0xff - self.headframe[self.chip][10] = (address>>8)&0xff - self.headframe[self.chip][11] = (address)&0xff - - data = array.array('B', self.headframe[self.chip]).tostring() - crc = self.calc_crc(data) - - data += chr((crc >> 8)&0xff) - data += chr(crc&0xff) - - self.sendframe(data,16) - - - def senddataframe(self,seq,data): - self.s.timeout = 0.15 - head = chr(0xDA) - head += chr(seq&0xFF) - head += chr((~seq)&0xFF) - - data = head + data - - crc = self.calc_crc(data) - data += chr((crc >> 8)&0xff) - data += chr(crc&0xff) - - self.sendframe(data,32) - - def sendtailframe(self,seq): - data = chr(0xED) - data += chr(seq&0xFF) - data += chr((~seq)&0xFF) - crc = self.calc_crc(data) - data += chr((crc >> 8)&0xff) - data += chr(crc&0xff) - - self.sendframe(data,16) - - def senddata(self, data, address): - length=len(data) - self.sendheadframe(length,address) - seq=1 - while length > self.MAX_DATA_LEN: - self.senddataframe(seq,data[(seq-1)*self.MAX_DATA_LEN:seq*self.MAX_DATA_LEN]) - seq = seq+1 - length = length-self.MAX_DATA_LEN - self.senddataframe(seq,data[(seq-1)*self.MAX_DATA_LEN:]) - self.sendtailframe(seq+1) - - - def download(self, filename1, filename2): - - f=open(filename1,"rb") - data = f.read() - f.close() - - print 'Sending', filename1, '...' - self.senddata(data,self.bootheadaddress[self.chip]) - print 'Done\n' - - if filename2: - f=open(filename2,"rb") - data = f.read() - f.close() - - print 'Sending', filename2, '...' - self.senddata(data,self.bootdownloadaddress[self.chip]) - print 'Done\n' - - -def burnboot(chiptype, serialport, filename1, filename2=''): - downloader = bootdownload(chiptype, serialport) - downloader.download(filename1, filename2) - -def startterm(serialport=0): - try: - miniterm = Miniterm( - serialport, - 115200, - 'N', - rtscts=False, - xonxoff=False, - echo=False, - convert_outgoing=2, - repr_mode=0, - ) - except serial.SerialException, e: - sys.stderr.write("could not open port %r: %s\n" % (port, e)) - sys.exit(1) - miniterm.start() - miniterm.join(True) - miniterm.join() - -def main(argv): - ''' - img2 = 'fastboot2.img' - ''' - img1 = 'fastboot1.img' - img2 = '' - dev = '/dev/serial/by-id/usb-䕇䕎䥎_㌲㔴㜶㤸-if00-port0' - try: - opts, args = getopt.getopt(argv,"hd:",["img1=","img2="]) - except getopt.GetoptError: - print 'hisi-idt.py -d device --img1 <fastboot1> --img2 <fastboot2>' - sys.exit(2) - for opt, arg in opts: - if opt == '-h': - print 'hisi-idt.py -d device --img1 <fastboot1> --img2 <fastboot2>' - sys.exit() - elif opt in ("-d"): - dev = arg - elif opt in ("--img1"): - img1 = arg - elif opt in ("--img2"): - img2 = arg - print '+----------------------+' - print ' Serial: ', dev - print ' Image1: ', img1 - print ' Image2: ', img2 - print '+----------------------+\n' - - if not os.path.isfile(img1): - print "Image don't exists:", img1 - sys.exit(1) - - if (img2): - if not os.path.isfile(img2): - print "Image don't exists:", img2 - sys.exit(1) - - burnboot('hi3716cv200', dev, img1, img2) - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/installer/hikey/l-loader.bin b/installer/hikey/l-loader.bin Binary files differdeleted file mode 100644 index 3c271e3b..00000000 --- a/installer/hikey/l-loader.bin +++ /dev/null diff --git a/installer/hikey/nvme.img b/installer/hikey/nvme.img Binary files differdeleted file mode 100644 index e2c8fe92..00000000 --- a/installer/hikey/nvme.img +++ /dev/null diff --git a/installer/hikey/ptable-aosp-4g.img b/installer/hikey/ptable-aosp-4g.img Binary files differdeleted file mode 100644 index 43bf8a94..00000000 --- a/installer/hikey/ptable-aosp-4g.img +++ /dev/null diff --git a/installer/hikey/ptable-aosp-8g.img b/installer/hikey/ptable-aosp-8g.img Binary files differdeleted file mode 100644 index 631fd8a9..00000000 --- a/installer/hikey/ptable-aosp-8g.img +++ /dev/null diff --git a/installer/hikey960/fip.bin b/installer/hikey960/fip.bin Binary files differdeleted file mode 100644 index 53d49504..00000000 --- a/installer/hikey960/fip.bin +++ /dev/null diff --git a/installer/hikey960/flash-all.sh b/installer/hikey960/flash-all.sh index 2888020b..c894558c 100755 --- a/installer/hikey960/flash-all.sh +++ b/installer/hikey960/flash-all.sh @@ -1,30 +1,92 @@ #!/bin/bash INSTALLER_DIR="`dirname ${0}`" +ECHO_PREFIX="=== " # for cases that don't run "lunch hikey960-userdebug" if [ -z "${ANDROID_BUILD_TOP}" ]; then - ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ + ANDROID_BUILD_TOP=$(cd ${INSTALLER_DIR}/../../../../../; pwd) ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960" fi if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then - echo "error in locating out directory, check if it exist" + echo ${ECHO_PREFIX}"error in locating out directory, check if it exist" exit fi -echo "android out dir:${ANDROID_PRODUCT_OUT}" - -fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img -fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img -fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img -fastboot reboot-bootloader -fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img -fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img -fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin -fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img -fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img -fastboot flash system "${ANDROID_PRODUCT_OUT}"/system.img -fastboot flash vendor "${ANDROID_PRODUCT_OUT}"/vendor.img -fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img +echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}" + +. "${ANDROID_BUILD_TOP}/device/linaro/hikey/vendor-package-ver.sh" + +VENDOR_DIR=$ANDROID_BUILD_TOP/vendor/linaro/hikey960/${EXPECTED_LINARO_VENDOR_VERSION}/ + +# TODO: Pull one-time recovery/qdl path out of standard install +# Flash bootloader firmware files +if [ ! -d "${VENDOR_DIR}/" ]; then + echo "FLASH-ALL-AOSP: Missing vendor firmware package?" + echo " Make sure the vendor binaries have been downloaded from" + echo " ${VND_PKG_URL}" + echo " and extracted to $ANDROID_BUILD_TOP." + exit +fi + +pushd $VENDOR_DIR/bootloader/ + +function check_partition_table_version () { + fastboot erase reserved + if [ $? -eq 0 ] + then + IS_PTABLE_1MB_ALIGNED=true + else + IS_PTABLE_1MB_ALIGNED=false + fi +} + +function flashing_atf_uefi () { + fastboot flash ptable prm_ptable.img + fastboot flash xloader hisi-sec_xloader.img + fastboot reboot-bootloader + + fastboot flash fastboot l-loader.bin + fastboot flash fip fip.bin + fastboot flash nvme hisi-nvme.img + fastboot flash fw_lpm3 hisi-lpm3.img + fastboot flash trustfirmware hisi-bl31.bin + fastboot reboot-bootloader + + fastboot flash ptable prm_ptable.img + fastboot flash xloader hisi-sec_xloader.img + fastboot flash fastboot l-loader.bin + fastboot flash fip fip.bin + + fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img + fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img + fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img + fastboot format cache +} + +function upgrading_ptable_1mb_aligned () { + fastboot flash xloader hisi-sec_xloader.img + fastboot flash ptable hisi-ptable.img + fastboot flash fastboot hisi-fastboot.img + fastboot reboot-bootloader +} + +echo ${ECHO_PREFIX}"Checking partition table version..." +check_partition_table_version + +if [ "${IS_PTABLE_1MB_ALIGNED}" == "true" ] +then + echo ${ECHO_PREFIX}"Partition table is 1MB aligned. Flashing ATF/UEFI..." + flashing_atf_uefi +else + echo ${ECHO_PREFIX}"Partition table is 512KB aligned." + echo ${ECHO_PREFIX}"Upgrading to 1MB aligned version..." + upgrading_ptable_1mb_aligned + echo ${ECHO_PREFIX}"Flashing ATF/UEFI..." + flashing_atf_uefi + echo ${ECHO_PREFIX}"Done" +fi + fastboot reboot +popd diff --git a/installer/hikey960/hisi-bl31.bin b/installer/hikey960/hisi-bl31.bin Binary files differdeleted file mode 100644 index abebea6d..00000000 --- a/installer/hikey960/hisi-bl31.bin +++ /dev/null diff --git a/installer/hikey960/hisi-fastboot.img b/installer/hikey960/hisi-fastboot.img Binary files differdeleted file mode 100644 index 72cbf90f..00000000 --- a/installer/hikey960/hisi-fastboot.img +++ /dev/null diff --git a/installer/hikey960/hisi-lpm3.img b/installer/hikey960/hisi-lpm3.img Binary files differdeleted file mode 100644 index bd0243bf..00000000 --- a/installer/hikey960/hisi-lpm3.img +++ /dev/null diff --git a/installer/hikey960/hisi-nvme.img b/installer/hikey960/hisi-nvme.img Binary files differdeleted file mode 100644 index ca5bc7c1..00000000 --- a/installer/hikey960/hisi-nvme.img +++ /dev/null diff --git a/installer/hikey960/hisi-ptable.img b/installer/hikey960/hisi-ptable.img Binary files differdeleted file mode 100644 index 3a4fe68c..00000000 --- a/installer/hikey960/hisi-ptable.img +++ /dev/null diff --git a/installer/hikey960/hisi-sec_xloader.img b/installer/hikey960/hisi-sec_xloader.img Binary files differdeleted file mode 100644 index 47c353b8..00000000 --- a/installer/hikey960/hisi-sec_xloader.img +++ /dev/null diff --git a/installer/hikey960/l-loader.bin b/installer/hikey960/l-loader.bin Binary files differdeleted file mode 100644 index 2ad7a238..00000000 --- a/installer/hikey960/l-loader.bin +++ /dev/null diff --git a/installer/hikey960/mkdtimg b/installer/hikey960/mkdtimg deleted file mode 100755 index 65722043..00000000 --- a/installer/hikey960/mkdtimg +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python -# Copyright 2017, The Android Open Source Project -# -# 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. -from __future__ import print_function -try: - from os import fstat, stat, remove - from sys import exit - from argparse import ArgumentParser, FileType - from ctypes import sizeof, Structure, c_char, c_int - from struct import pack, calcsize - import zlib -except Exception as e: - print("some module is needed:" + str(e)) - exit(-1) - -dt_head_info_fmt = '4sII' -dt_entry_fmt = 'Q4I2Q' -dtimg_version = 1 -dtb_count = 1 - -def write32(output, value): - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) ; value=value // 256 - output.write(chr(value & 255)) - -def compress(filename, input, output): - output.write('\037\213\010') - output.write(chr(0)) - - statval = stat(filename) - write32(output, 0) - output.write('\002') - output.write('\003') - - crcval = zlib.crc32("") - compobj = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS, - zlib.DEF_MEM_LEVEL, 0) - while True: - data = input.read(1024) - if data == "": - break - crcval = zlib.crc32(data, crcval) - output.write(compobj.compress(data)) - output.write(compobj.flush()) - write32(output, crcval) - write32(output, statval.st_size) - -def dtb_compress(dtb_file): - try: - outputname = dtb_file + '.gz' - input = open(dtb_file, 'rb') - output = open(outputname, 'wb') - compress(dtb_file, input, output) - input.close() - output.close() - except Exception as e: - print('dtb_compress error:' + str(e)) - exit(-1) - return outputname - -class dt_head_info(Structure): - _fields_ = [('magic', c_char * 4), - ('version', c_int), - ('dt_count', c_int)] - -class dt_entry_t(Structure): - _fields_ = [('dtb_size', c_int), - ('dtb_offset', c_int)] - -def align_page_size(offset, pagesize): - return (pagesize - (offset % pagesize)) - -def write_head_info(head_info, args): - args.output.write(pack(dt_head_info_fmt, - head_info.magic, - head_info.version, - head_info.dt_count)) - -def write_dtb_entry_t(dt_entry, args): - args.output.write(pack(dt_entry_fmt, - 0, # reserved - dt_entry.dtb_size, - 0, # reserved - dt_entry.dtb_offset, - 0, # reserved - 0, # reserved - 0)) # reserved - -def write_padding(args, padding): - for i in range(0, padding): - args.output.write('\x00') - -def write_dtb(args): - dtb_file = args.dtb - out_dtb = dtb_file - if args.compress == True: - out_dtb = dtb_compress(dtb_file) - try: - dtb_offset = calcsize(dt_head_info_fmt) + \ - calcsize(dt_entry_fmt) + \ - 4 - padding = align_page_size(dtb_offset, args.pagesize) - dtb_size = stat(out_dtb).st_size - dtb_size_padding = align_page_size(dtb_size, args.pagesize) - dt_entry = dt_entry_t(dtb_size + dtb_size_padding, - dtb_offset + padding) - write_dtb_entry_t(dt_entry, args) - args.output.write(pack('I', 0)) # SUCCESS code number - write_padding(args, padding) - with open(out_dtb, 'rb') as dtb_fd: - args.output.write(dtb_fd.read(dtb_size)) - write_padding(args, dtb_size_padding) - except Exception as e: - print('write dtb error:' + str(e)) - exit(-1) - -def clean_gz_file(args): - try: - if args.compress != True: - return - remove(args.dtb + '.gz') - except Exception as e: - print('clean gz file error:' + str(e)) - exit(-1) - -def parse_cmdline(): - parser = ArgumentParser() - parser.add_argument('-c', '--compress', help='compress dtb or not', - action='store_true') - parser.add_argument('-d', '--dtb', help='path to the dtb', type=str, - required=True) - parser.add_argument('-s', '--pagesize', help='align page size', - type=int, choices=[2**i for i in range(11,15)], - default=2048) - parser.add_argument('-o', '--output', help='output file name', - type=FileType('wb'), required=True) - return parser.parse_args() - -def main(): - args = parse_cmdline() - dtimg_head_info = dt_head_info('HSDT', dtimg_version, dtb_count) - write_head_info(dtimg_head_info, args) - write_dtb(args) - clean_gz_file(args) - -if __name__ == '__main__': - main() diff --git a/installer/hikey960/prm_ptable.img b/installer/hikey960/prm_ptable.img Binary files differdeleted file mode 100644 index c81ffcfa..00000000 --- a/installer/hikey960/prm_ptable.img +++ /dev/null diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh deleted file mode 100755 index fe42486c..00000000 --- a/installer/hikey960/uefi-flash-all.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -INSTALLER_DIR="`dirname ${0}`" -ECHO_PREFIX="=== " - -# for cases that don't run "lunch hikey960-userdebug" -if [ -z "${ANDROID_BUILD_TOP}" ]; then - ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ - ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960" -fi - -if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then - echo ${ECHO_PREFIX}"error in locating out directory, check if it exist" - exit -fi - -echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}" - -function check_partition_table_version () { - fastboot erase reserved - if [ $? -eq 0 ] - then - IS_PTABLE_1MB_ALIGNED=true - else - IS_PTABLE_1MB_ALIGNED=false - fi -} - -function flashing_atf_uefi () { - fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot reboot-bootloader - - fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin - fastboot flash fip "${INSTALLER_DIR}"/fip.bin - fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img - fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img - fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin - fastboot reboot-bootloader - - fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin - fastboot flash fip "${INSTALLER_DIR}"/fip.bin - - fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img - fastboot flash system "${ANDROID_PRODUCT_OUT}"/system.img - fastboot flash vendor "${ANDROID_PRODUCT_OUT}"/vendor.img - fastboot flash cache "${ANDROID_PRODUCT_OUT}"/cache.img - fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img -} - -function upgrading_ptable_1mb_aligned () { - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img - fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img - fastboot reboot-bootloader -} - -echo ${ECHO_PREFIX}"Checking partition table version..." -check_partition_table_version - -if [ "${IS_PTABLE_1MB_ALIGNED}" == "true" ] -then - echo ${ECHO_PREFIX}"Partition table is 1MB aligned. Flashing ATF/UEFI..." - flashing_atf_uefi -else - echo ${ECHO_PREFIX}"Partition table is 512KB aligned." - echo ${ECHO_PREFIX}"Upgrading to 1MB aligned version..." - upgrading_ptable_1mb_aligned - echo ${ECHO_PREFIX}"Flasing ATF/UEFI..." - flashing_atf_uefi - echo ${ECHO_PREFIX}"Done" -fi - -fastboot reboot diff --git a/kernel-headers/linux/audio_hifi.h b/kernel-headers/linux/audio_hifi.h deleted file mode 100644 index 2fff5d9a..00000000 --- a/kernel-headers/linux/audio_hifi.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _AUDIO_HIFI_H -#define _AUDIO_HIFI_H - -#include <linux/types.h> - -struct misc_io_dump_buf_param { - uint64_t user_buf; - unsigned int clear; /*clear current log buf */ - unsigned int buf_size; -}; - -struct misc_io_pcm_buf_param { - uint64_t buf; - uint32_t buf_size; -}; - -#define HIFI_DSP_MISC_DRIVER "/dev/hifi_misc" - -#define HIFI_MISC_IOCTL_ASYNCMSG _IOWR('A', 0x70, struct misc_io_async_param) -#define HIFI_MISC_IOCTL_SYNCMSG _IOW('A', 0x71, struct misc_io_sync_param) -#define HIFI_MISC_IOCTL_SENDDATA_SYNC _IOW('A', 0x72, struct misc_io_senddata_sync_param) -#define HIFI_MISC_IOCTL_GET_PHYS _IOWR('A', 0x73, struct misc_io_get_phys_param) -#define HIFI_MISC_IOCTL_TEST _IOWR('A', 0x74, struct misc_io_senddata_sync_param) -#define HIFI_MISC_IOCTL_WRITE_PARAMS _IOWR('A', 0x75, struct misc_io_sync_param) -#define HIFI_MISC_IOCTL_DUMP_HIFI _IOWR('A', 0x76, struct misc_io_dump_buf_param) -#define HIFI_MISC_IOCTL_DUMP_CODEC _IOWR('A', 0x77, struct misc_io_dump_buf_param) -#define HIFI_MISC_IOCTL_WAKEUP_THREAD _IOW('A', 0x78, unsigned int) -#define HIFI_MISC_IOCTL_DISPLAY_MSG _IOWR('A', 0x79, struct misc_io_dump_buf_param) -#define HIFI_MISC_IOCTL_WAKEUP_PCM_READ_THREAD _IOW('A', 0x7a, unsigned int) -#define HIFI_MISC_IOCTL_PCM_GAIN _IOW('A', 0x7b, struct misc_io_pcm_buf_param) -#define HIFI_MISC_IOCTL_XAF_IPC_MSG_SEND _IOW('A', 0x7c, xf_proxy_msg_t) -#define HIFI_MISC_IOCTL_XAF_IPC_MSG_RECV _IOR('A', 0x7d, xf_proxy_msg_t) - -#ifdef CLT_VOICE -#define CLT_HIFI_MISC_IOCTL_SEND_VOICE _IOWR('A', 0x90, struct misc_io_async_param) -#endif - -#define HIFI_MISC_IOCTL_GET_VOICE_BSD_PARAM _IOWR('A', 0x7c, unsigned int) - -#define DRV_DSP_UART_TO_MEM_SIZE 0x7f000 - -#endif /* _AUDIO_HIFI_H */ diff --git a/l-loader/.gitignore b/l-loader/.gitignore deleted file mode 100644 index b282a0e1..00000000 --- a/l-loader/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.o -/*.img -/*.bin diff --git a/l-loader/COPYING b/l-loader/COPYING deleted file mode 100644 index 4ad3f200..00000000 --- a/l-loader/COPYING +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2014-2016, Linaro 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: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* 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. - -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. diff --git a/l-loader/Makefile b/l-loader/Makefile deleted file mode 100644 index 5331c399..00000000 --- a/l-loader/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -.PHONY: hikey -hikey: - $(MAKE) -f hikey.mk - -.PHONY: hikey-clean -hikey-clean: - $(MAKE) -f hikey.mk clean - -.PHONY: hikey960 -hikey960: - $(MAKE) -f hikey960.mk - -.PHONY: hikey960-clean -hikey960-clean: - $(MAKE) -f hikey960.mk clean diff --git a/l-loader/README.md b/l-loader/README.md deleted file mode 100644 index e5dcd990..00000000 --- a/l-loader/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# l-loader - -Used to switch from aarch32 to aarch64 and boot. First image to be flashed -when in recovery mode. - -HiKey specific. diff --git a/l-loader/gen_loader.py b/l-loader/gen_loader.py deleted file mode 100755 index 2d763ca9..00000000 --- a/l-loader/gen_loader.py +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env python - -import os -import os.path -import sys, getopt -import binascii -import struct -import string - -class generator(object): - # - # struct l_loader_head { - # unsigned int first_instr; - # unsigned char magic[16]; @ BOOTMAGICNUMBER! - # unsigned int l_loader_start; - # unsigned int l_loader_end; - # }; - file_header = [0, 0, 0, 0, 0, 0, 0] - - # - # struct entry_head { - # unsigned char magic[8]; @ ENTY - # unsigned char name[8]; @ loader/bl1 - # unsigned int start_lba; - # unsigned int count_lba; - # unsigned int flag; @ boot partition or not - # }; - - s1_entry_name = ['loader', 'bl1'] - s2_entry_name = ['primary', 'second'] - - block_size = 512 - - stage = 0 - - # set in self.add() - idx = 0 - - # set in self.parse() - ptable_lba = 0 - stable_lba = 0 - - # file pointer - p_entry = 0 - p_file = 0 - - def __init__(self, out_img): - try: - self.fp = open(out_img, "wb+") - except IOError, e: - print "*** file open error:", e - sys.exit(3) - else: - self.entry_hd = [[0 for col in range(7)] for row in range(5)] - - def __del__(self): - self.fp.close() - - # parse partition from the primary ptable - def parse(self, fname): - try: - fptable = open(fname, "rb") - except IOError, e: - print "*** file open error:", e - sys.exit(3) - else: - # skip the first block in primary partition table - # that is MBR protection information - fptable.read(self.block_size) - # check whether it's a primary paritition table - data = struct.unpack("8s", fptable.read(8)) - efi_magic = 'EFI PART' - if cmp("EFI PART", data[0]): - print "It's not partition table image." - fptable.close() - sys.exit(4) - # skip 16 bytes - fptable.read(16) - # get lba of both primary partition table and secondary partition table - data = struct.unpack("QQQQ", fptable.read(32)) - self.ptable_lba = data[0] - 1 - self.stable_lba = data[3] + 1 - # skip 24 bytes - fptable.read(24) - data = struct.unpack("i", fptable.read(4)) - pentries = data[0] - # skip the reset in this block - fptable.read(self.block_size - 84) - - for i in range(1, pentries): - # name is encoded as UTF-16 - d0,lba,d2,name = struct.unpack("32sQ16s72s", fptable.read(128)) - plainname = unicode(name, "utf-16") - if (not cmp(plainname[0:7], 'l-loader'[0:7])): - print 'bl1_lba: ', lba - self.bl1_lba = lba - sys.exit(1) - - fptable.close() - - def add(self, lba, fname): - try: - fsize = os.path.getsize(fname) - except IOError, e: - print "*** file open error:", e - sys.exit(4) - else: - blocks = (fsize + self.block_size - 1) / self.block_size - if (self.stage == 1): - # Boot Area1 in eMMC - bootp = 1 - if self.idx == 0: - self.p_entry = 28 - elif (self.stage == 2): - # User Data Area in eMMC - bootp = 0 - # create an empty block only for stage2 - # This empty block is used to store entry head - print 'p_file: ', self.p_file, 'p_entry: ', self.p_entry - if self.idx == 0: - self.fp.seek(self.p_file) - for i in range (0, self.block_size): - zero = struct.pack('x') - self.fp.write(zero) - self.p_file += self.block_size - self.p_entry = 0 - else: - print "wrong stage ", stage, "is specified" - sys.exit(4) - # Maybe the file size isn't aligned. So pad it. - if (self.idx == 0) and (self.stage == 1): - if fsize > 2048: - print 'loader size exceeds 2KB. file size: ', fsize - sys.exit(4) - else: - left_bytes = 2048 - fsize - else: - left_bytes = fsize % self.block_size - if left_bytes: - left_bytes = self.block_size - left_bytes - print 'lba: ', lba, 'blocks: ', blocks, 'bootp: ', bootp, 'fname: ', fname - # write images - fimg = open(fname, "rb") - for i in range (0, blocks): - buf = fimg.read(self.block_size) - self.fp.seek(self.p_file) - self.fp.write(buf) - # p_file is the file pointer of the new binary file - # At last, it means the total block size of the new binary file - self.p_file += self.block_size - - if (self.idx == 0) and (self.stage == 1): - self.p_file = 2048 - print 'p_file: ', self.p_file, 'last block is ', fsize % self.block_size, 'bytes', ' tell: ', self.fp.tell(), 'left_bytes: ', left_bytes - if left_bytes: - for i in range (0, left_bytes): - zero = struct.pack('x') - self.fp.write(zero) - print 'p_file: ', self.p_file, ' pad to: ', self.fp.tell() - - # write entry information at the header - if self.stage == 1: - byte = struct.pack('8s8siii', 'ENTRYHDR', self.s1_entry_name[self.idx], lba, blocks, bootp) - elif self.stage == 2: - byte = struct.pack('8s8siii', 'ENTRYHDR', self.s2_entry_name[self.idx], lba, blocks, bootp) - self.fp.seek(self.p_entry) - self.fp.write(byte) - self.p_entry += 28 - self.idx += 1 - - fimg.close() - - def hex2(self, data): - return data > 0 and hex(data) or hex(data & 0xffffffff) - - def end(self): - if self.stage == 1: - self.fp.seek(20) - start,end = struct.unpack("ii", self.fp.read(8)) - print "start: ", self.hex2(start), 'end: ', self.hex2(end) - end = start + self.p_file - print "start: ", self.hex2(start), 'end: ', self.hex2(end) - self.fp.seek(24) - byte = struct.pack('i', end) - self.fp.write(byte) - self.fp.close() - - def create_stage1(self, img_loader, img_bl1, output_img): - print '+-----------------------------------------------------------+' - print ' Input Images:' - print ' loader: ', img_loader - print ' bl1: ', img_bl1 - print ' Ouput Image: ', output_img - print '+-----------------------------------------------------------+\n' - - self.stage = 1 - - # The first 2KB is reserved - # The next 2KB is for loader image - self.add(4, img_loader) # img_loader doesn't exist in partition table - print 'self.idx: ', self.idx - # bl1.bin starts from 4KB - self.add(8, img_bl1) # img_bl1 doesn't exist in partition table - - def create_stage2(self, img_prm_ptable, img_sec_ptable, output_img): - print '+-----------------------------------------------------------+' - print ' Input Images:' - print ' primary partition table: ', img_prm_ptable - print ' secondary partition table: ', img_sec_ptable - print ' Ouput Image: ', output_img - print '+-----------------------------------------------------------+\n' - - self.stage = 2 - self.parse(img_prm_ptable) - self.add(self.ptable_lba, img_prm_ptable) - if (cmp(img_sec_ptable, 'secondary partition table')): - # Doesn't match. It means that secondary ptable is specified. - self.add(self.stable_lba, img_sec_ptable) - else: - print 'Don\'t need secondary partition table' - -def main(argv): - stage1 = 0 - stage2 = 0 - img_prm_ptable = "primary partition table" - img_sec_ptable = "secondary partition table" - try: - opts, args = getopt.getopt(argv,"ho:",["img_loader=","img_bl1=","img_prm_ptable=","img_sec_ptable="]) - except getopt.GetoptError: - print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_prm_ptable <prm_ptable.img> --img_sec_ptable <sec_ptable.img>' - sys.exit(2) - for opt, arg in opts: - if opt == '-h': - print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_prm_ptable <prm_ptable.img> --img_sec_ptable <sec_ptable.img>' - sys.exit(1) - elif opt == '-o': - output_img = arg - elif opt in ("--img_loader"): - img_loader = arg - stage1 = 1 - elif opt in ("--img_bl1"): - img_bl1 = arg - stage1 = 1 - elif opt in ("--img_prm_ptable"): - img_prm_ptable = arg - stage2 = 1 - elif opt in ("--img_sec_ptable"): - img_sec_ptable = arg - - loader = generator(output_img) - loader.idx = 0 - - if (stage1 == 1) and (stage2 == 1): - print 'There are only loader & BL1 in stage1.' - print 'And there are primary partition table, secondary partition table and FIP in stage2.' - sys.exit(1) - elif (stage1 == 0) and (stage2 == 0): - print 'No input images are specified.' - sys.exit(1) - elif stage1 == 1: - loader.create_stage1(img_loader, img_bl1, output_img) - elif stage2 == 1: - loader.create_stage2(img_prm_ptable, img_sec_ptable, output_img) - - loader.end() - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/l-loader/gen_loader_hikey.py b/l-loader/gen_loader_hikey.py deleted file mode 100755 index a07eb986..00000000 --- a/l-loader/gen_loader_hikey.py +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env python - -import os -import os.path -import sys, getopt -import binascii -import struct -import string - -# -------------------------- -# | loader | BL1 | NS BL1U | -# -------------------------- - -class generator(object): - # - # struct l_loader_head { - # unsigned int first_instr; - # unsigned char magic[16]; @ BOOTMAGICNUMBER! - # unsigned int l_loader_start; @ start of loader - # unsigned int l_loader_end; @ end of BL1 (without ns_bl1u) - # }; - file_header = [0, 0, 0, 0, 0, 0, 0] - - # - # struct entry_head { - # unsigned char magic[8]; @ ENTY - # unsigned char name[8]; @ loader/bl1/ns_bl1u - # unsigned int start_lba; - # unsigned int count_lba; - # unsigned int flag; @ boot partition or not - # }; - # size of struct entry_head is 28 - # - - s1_entry_name = ['loader', 'bl1', 'ns_bl1u'] - - block_size = 512 - - # set in self.add() - idx = 0 - - # file pointer - p_entry = 0 # pointer in header - p_file = 0 # pointer in file - p_loader_end = 0 # pointer in header - - def __init__(self, out_img): - try: - self.fp = open(out_img, "wb+") - except IOError, e: - print "*** file open error:", e - sys.exit(3) - else: - self.entry_hd = [[0 for col in range(7)] for row in range(5)] - - def __del__(self): - self.fp.close() - - def add(self, lba, fname): - try: - fsize = os.path.getsize(fname) - except IOError, e: - print "*** file open error:", e - sys.exit(4) - else: - blocks = (fsize + self.block_size - 1) / self.block_size - # Boot Area1 in eMMC - bootp = 1 - if self.idx == 0: - # both loader and bl1.bin locates in l-loader.bin bias 2KB - self.p_entry = 28 - elif (self.idx > 1): - # image: ns_bl1u - # Record the end of loader & BL1. ns_bl1u won't be loaded by BootROM. - self.p_loader_end = self.p_file - # ns_bl1u should locates in l-loader.bin bias 2KB too - if (self.p_file < (lba * self.block_size - 2048)): - self.p_file = lba * self.block_size - 2048 - - # Maybe the file size isn't aligned. So pad it. - if (self.idx == 0): - if fsize > 2048: - print 'loader size exceeds 2KB. file size: ', fsize - sys.exit(4) - else: - left_bytes = 2048 - fsize - else: - left_bytes = fsize % self.block_size - if left_bytes: - left_bytes = self.block_size - left_bytes - print 'lba: ', lba, 'blocks: ', blocks, 'bootp: ', bootp, 'fname: ', fname - # write images - fimg = open(fname, "rb") - for i in range (0, blocks): - buf = fimg.read(self.block_size) - # loader's p_file is 0 at here - self.fp.seek(self.p_file) - self.fp.write(buf) - # p_file is the file pointer of the new binary file - # At last, it means the total block size of the new binary file - self.p_file += self.block_size - - if (self.idx == 0): - self.p_file = 2048 - print 'p_file: ', self.p_file, 'last block is ', fsize % self.block_size, 'bytes', ' tell: ', self.fp.tell(), 'left_bytes: ', left_bytes - if left_bytes: - for i in range (0, left_bytes): - zero = struct.pack('x') - self.fp.write(zero) - print 'p_file: ', self.p_file, ' pad to: ', self.fp.tell() - - # write entry information at the header - byte = struct.pack('8s8siii', 'ENTRYHDR', self.s1_entry_name[self.idx], lba, blocks, bootp) - self.fp.seek(self.p_entry) - self.fp.write(byte) - self.p_entry += 28 - self.idx += 1 - - fimg.close() - - def hex2(self, data): - return data > 0 and hex(data) or hex(data & 0xffffffff) - - def end(self): - self.fp.seek(20) - start,end = struct.unpack("ii", self.fp.read(8)) - print "start: ", self.hex2(start), 'end: ', self.hex2(end) - end = start + self.p_loader_end - print "start: ", self.hex2(start), 'end: ', self.hex2(end) - self.fp.seek(24) - byte = struct.pack('i', end) - self.fp.write(byte) - self.fp.close() - - def create(self, img_loader, img_bl1, img_ns_bl1u, output_img): - print '+-----------------------------------------------------------+' - print ' Input Images:' - print ' loader: ', img_loader - print ' bl1: ', img_bl1 - print ' ns_bl1u: ', img_ns_bl1u - print ' Ouput Image: ', output_img - print '+-----------------------------------------------------------+\n' - - self.stage = 1 - - # The first 2KB is reserved - # The next 2KB is for loader image - self.add(4, img_loader) - print 'self.idx: ', self.idx - # bl1.bin starts from 4KB - self.add(8, img_bl1) - if img_ns_bl1u != 0: - # ns_bl1u.bin starts from 96KB - self.add(192, img_ns_bl1u) - -def main(argv): - img_ns_bl1u = 0 - try: - opts, args = getopt.getopt(argv,"ho:",["img_loader=","img_bl1=","img_ns_bl1u="]) - except getopt.GetoptError: - print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_ns_bl1u <ns_bl1u.bin>' - sys.exit(2) - for opt, arg in opts: - if opt == '-h': - print 'gen_loader.py -o <l-loader.bin> --img_loader <l-loader> --img_bl1 <bl1.bin> --img_ns_bl1u <ns_bl1u.bin>' - sys.exit(1) - elif opt == '-o': - output_img = arg - elif opt in ("--img_loader"): - img_loader = arg - elif opt in ("--img_bl1"): - img_bl1 = arg - elif opt in ("--img_ns_bl1u"): - img_ns_bl1u = arg - - loader = generator(output_img) - loader.idx = 0 - - loader.create(img_loader, img_bl1, img_ns_bl1u, output_img) - - loader.end() - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/l-loader/generate_ptable.sh b/l-loader/generate_ptable.sh deleted file mode 100755 index f8a6a207..00000000 --- a/l-loader/generate_ptable.sh +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/sh -# -# Generate partition table for HiKey eMMC or HiKey960 UFS -# -# tiny: for testing purpose. -# aosp: (same as linux with userdata). -# linux: (same as aosp without userdata). -# swap: (similar to asop, drop reserved, 1.5G of swap) - -PTABLE=${PTABLE:-aosp} -SECTOR_SIZE=${SECTOR_SIZE:-512} -SGDISK=${SGDISK:-sgdisk} -TEMP_FILE=$(mktemp /tmp/${PTABLE}.XXXXXX) -# 128 entries at most -ENTRIES_IN_SECTOR=$(expr ${SECTOR_SIZE} / 128) -ENTRY_SECTORS=$(expr 128 / ${ENTRIES_IN_SECTOR}) -PRIMARY_SECTORS=$(expr ${ENTRY_SECTORS} + 2) -SECONDARY_SECTORS=$(expr ${ENTRY_SECTORS} + 1) - -case ${PTABLE} in - tiny) - SECTOR_NUMBER=81920 - ;; - aosp-4g|linux-4g) - SECTOR_NUMBER=7471104 - ;; - aosp-8g|linux-8g|swap-8g) - SECTOR_NUMBER=15269888 - ;; - aosp-32g*|linux-32g) - SECTOR_NUMBER=62447650 # count with 512-byte block size - ;; - aosp-64g|linux-64g) - SECTOR_NUMBER=124895300 # count with 512-byte block size - ;; -esac - -SECTOR_ALIGNMENT=$(expr ${SECTOR_SIZE} / 512) -SECTOR_NUMBER=$(expr '(' ${SECTOR_NUMBER} '*' 512 + ${SECTOR_SIZE} - 1 ')' / ${SECTOR_SIZE}) - -# get the partition table -case ${PTABLE} in - tiny) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U -R -v ${TEMP_FILE} - fakeroot ${SGDISK} -n 1:2048:4095 -t 1:0700 -u 1:F9F21F01-A8D4-5F0E-9746-594869AEC3E4 -c 1:"vrl" -p ${TEMP_FILE} - fakeroot ${SGDISK} -n 2:4096:6143 -t 2:0700 -u 2:F9F21F02-A8D4-5F04-9746-594869AEC3E4 -c 2:"vrl_backup" -p ${TEMP_FILE} - ;; - aosp-4g|aosp-8g) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} - #[1: vrl: 1M-2M] - fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} - #[2: vrl_backup: 2M-3M] - fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE} - #[3: mcuimage: 3M-4M] - fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE} - #[4: fastboot: 4M-12M] - fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE} - #[5: nvme: 12M-14M] - fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE} - #[6: boot: 14M-78M] - fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE} - #[7: vendor: 78M-334M] - fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"vendor" ${TEMP_FILE} - #[8: cache: 334M-590M] - fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE} - #[9: system: 590M-2126M] - fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE} - #[10: userdata: 2126M-End] - fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE} - ;; - linux-4g|linux-8g) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} - #[1: vrl: 1M-2M] - fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} - #[2: vrl_backup: 2M-3M] - fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE} - #[3: mcuimage: 3M-4M] - fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE} - #[4: fastboot: 4M-12M] - fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE} - #[5: nvme: 12M-14M] - fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE} - #[6: boot: 14M-78M] - fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE} - #[7: reserved: 78M-334M] - fakeroot ${SGDISK} -n 7:0:+256M -t 7:0700 -u 7:BED8EBDC-298E-4A7A-B1F1-2500D98453B7 -c 7:"reserved" ${TEMP_FILE} - #[8: cache: 334M-590M] - fakeroot ${SGDISK} -n 8:0:+256M -t 8:8301 -u 8:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 8:"cache" ${TEMP_FILE} - #[9: system: 590M-End] - fakeroot ${SGDISK} -n -E -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE} - ;; - swap-8g) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} - #[1: vrl: 1M-2M] - fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} - #[2: vrl_backup: 2M-3M] - fakeroot ${SGDISK} -n 2:0:+1M -t 2:0700 -u 2:61A36FC1-8EFB-4899-84D8-B61642EFA723 -c 2:"vrl_backup" ${TEMP_FILE} - #[3: mcuimage: 3M-4M] - fakeroot ${SGDISK} -n 3:0:+1M -t 3:0700 -u 3:65007411-962D-4781-9B2C-51DD7DF22CC3 -c 3:"mcuimage" ${TEMP_FILE} - #[4: fastboot: 4M-12M] - fakeroot ${SGDISK} -n 4:0:+8M -t 4:EF02 -u 4:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 4:"fastboot" ${TEMP_FILE} - #[5: nvme: 12M-14M] - fakeroot ${SGDISK} -n 5:0:+2M -t 5:0700 -u 5:00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43 -c 5:"nvme" ${TEMP_FILE} - #[6: boot: 14M-78M] - fakeroot ${SGDISK} -n 6:0:+64M -t 6:EF00 -u 6:5C0F213C-17E1-4149-88C8-8B50FB4EC70E -c 6:"boot" ${TEMP_FILE} - #[7: cache: 78M-384M] - fakeroot ${SGDISK} -n 7:0:+256M -t 7:8301 -u 7:A092C620-D178-4CA7-B540-C4E26BD6D2E2 -c 7:"cache" ${TEMP_FILE} - #[8: swap: 384M-1920M] - fakeroot ${SGDISK} -n 8:0:+1536M -t 8:8200 -u 8:FC56E344-2E8E-49AE-B2F8-5B9D263FE377 -c 8:"swap" ${TEMP_FILE} - #[9: system: 1920M-3556M] - fakeroot ${SGDISK} -n 9:0:+1536M -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE} - #[10: userdata: 3556M-End] - fakeroot ${SGDISK} -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE} - ;; - aosp-32g*|aosp-64g) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} - #[1: xloader_reserved1: 1M-2M] - fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"xloader_reserved1" ${TEMP_FILE} - #[2: fastboot: 2M-14M] - fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE} - #[3: nvme: 14M-20M] - fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE} - #[4: fip: 20M-32M] - fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE} - #[5: cache: 32M-288M] - fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE} - #[6: fw_lpm3: 288M-289M] - fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE} - #[7: boot: 289M-353M] - fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE} - #[8: dts: 353M-369M] - fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE} - #[9: trustfirmware: 369M-371M] - fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE} - #[10: system: 371M-5059M] - fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE} - #[11: vendor: 5059M-5843M] - fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE} - #[12: reserved: 5843M-5844M] - fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE} - case ${PTABLE} in - aosp-32g) - #[13: userdata: 5844M-End] - fakeroot ${SGDISK} -n -E -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE} - ;; - aosp-32g-spare) - #[13: userdata: 5844M-9844M] - fakeroot ${SGDISK} -n 13:0:+1000M -t 13:8300 -u 13:fea80d9c-f3e3-45d9-aed0-1d06e4abd77f -c 13:"userdata" ${TEMP_FILE} - #[14: swap: 9844M-End] - fakeroot ${SGDISK} -n -E -t 14:8300 -u 14:9501eade-20fb-4bc7-83d3-62c1be3ed92d -c 14:"swap" ${TEMP_FILE} - ;; - esac - ;; - linux-32g|linux-64g) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} conv=sparse - fakeroot ${SGDISK} -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} - #[1: vrl: 1M-2M] - fakeroot ${SGDISK} -n 1:0:+1M -t 1:0700 -u 1:697c41e0-7a59-4dfa-a9a6-aa43ac5be684 -c 1:"vrl" ${TEMP_FILE} - #[2: fastboot: 2M-14M] - fakeroot ${SGDISK} -n 2:0:+12M -t 2:0700 -u 2:3f5f8c48-4402-4ace-9058-30bfea4fa53f -c 2:"fastboot" ${TEMP_FILE} - #[3: nvme: 14M-20M] - fakeroot ${SGDISK} -n 3:0:+6M -t 3:0700 -u 3:e2f5e2a9-c9b7-4089-9859-4498f1d3ef7e -c 3:"nvme" ${TEMP_FILE} - #[4: fip: 20M-32M] - fakeroot ${SGDISK} -n 4:0:+12M -t 3:0700 -u 4:dc1a888e-f17c-4964-92d6-f8fcc402ed8b -c 4:"fip" ${TEMP_FILE} - #[5: cache: 32M-288M] - fakeroot ${SGDISK} -n 5:0:+256M -t 5:0700 -u 5:10cc3268-05f0-4db2-aa00-707361427fc8 -c 5:"cache" ${TEMP_FILE} - #[6: fw_lpm3: 288M-289M] - fakeroot ${SGDISK} -n 6:0:+1M -t 6:0700 -u 6:5d8481d4-c170-4aa8-9438-8743c73ea8f5 -c 6:"fw_lpm3" ${TEMP_FILE} - #[7: boot: 289M-353M] - fakeroot ${SGDISK} -n 7:0:+64M -t 7:EF00 -u 7:d3340696-9b95-4c64-8df6-e6d4548fba41 -c 7:"boot" ${TEMP_FILE} - #[8: dts: 353M-369M] - fakeroot ${SGDISK} -n 8:0:+16M -t 8:0700 -u 8:6e53b0bb-fa7e-4206-b607-5ae699e9f066 -c 8:"dts" ${TEMP_FILE} - #[9: trustfirmware: 369M-371M] - fakeroot ${SGDISK} -n 9:0:+2M -t 9:0700 -u 9:f1e126a6-ceef-45c1-aace-29f33ac9cf13 -c 9:"trustfirmware" ${TEMP_FILE} - #[10: system: 371M-5059M] - fakeroot ${SGDISK} -n 10:0:+4688M -t 10:8300 -u 10:c3e50923-fb85-4153-b925-759614d4dfcd -c 10:"system" ${TEMP_FILE} - #[11: vendor: 5059M-5843M] - fakeroot ${SGDISK} -n 11:0:+784M -t 11:0700 -u 11:919d7080-d71a-4ae1-9227-e4585210c837 -c 11:"vendor" ${TEMP_FILE} - #[12: reserved: 5843M-5844M] - fakeroot ${SGDISK} -n 12:0:+1M -t 12:0700 -u 12:611eac6b-bc42-4d72-90ac-418569c8e9b8 -c 12:"reserved" ${TEMP_FILE} - ;; -esac - -# get the primary partition table -dd if=${TEMP_FILE} of=prm_ptable.img bs=${SECTOR_SIZE} count=${PRIMARY_SECTORS} - -BK_PTABLE_LBA=$(expr ${SECTOR_NUMBER} - ${SECONDARY_SECTORS}) -dd if=${TEMP_FILE} of=sec_ptable.img skip=${BK_PTABLE_LBA} bs=${SECTOR_SIZE} count=${SECONDARY_SECTORS} - -rm -f ${TEMP_FILE} diff --git a/l-loader/hikey.mk b/l-loader/hikey.mk deleted file mode 100644 index 16c1d975..00000000 --- a/l-loader/hikey.mk +++ /dev/null @@ -1,31 +0,0 @@ -CROSS_COMPILE?=arm-linux-gnueabihf- -CC=$(CROSS_COMPILE)gcc -LD=$(CROSS_COMPILE)ld -OBJCOPY=$(CROSS_COMPILE)objcopy -CFLAGS=-march=armv7-a - -BL1=bl1.bin -NS_BL1U=recovery-fastboot.bin -PTABLE_LST?=aosp-8g aosp-4g - -.PHONY: all -all: l-loader.bin prm_ptable.img - -%.o: %.S - $(CC) $(CFLAGS) -c -o $@ $< - -l-loader.bin: start.o $(BL1) $(NS_BL1U) - $(LD) -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o -o loader - $(OBJCOPY) -O binary loader temp - python gen_loader_hikey.py -o $@ --img_loader=temp --img_bl1=$(BL1) --img_ns_bl1u=$(NS_BL1U) - rm -f loader temp - -prm_ptable.img: - for ptable in $(PTABLE_LST); do \ - PTABLE=$${ptable} SECTOR_SIZE=512 bash -x generate_ptable.sh;\ - cp prm_ptable.img ptable-$${ptable}.img;\ - done - -.PHONY: clean -clean: - rm -f *.o *.img l-loader.bin diff --git a/l-loader/hikey960.mk b/l-loader/hikey960.mk deleted file mode 100644 index e378b75e..00000000 --- a/l-loader/hikey960.mk +++ /dev/null @@ -1,19 +0,0 @@ -BL1=bl1.bin -NS_BL1U=BL33_AP_UEFI.fd -PTABLE_LST:=aosp-32g aosp-32g-spare linux-32g - -.PHONY: all -all: l-loader.bin prm_ptable.img - -l-loader.bin: $(BL1) $(NS_BL1U) - python gen_loader_hikey960.py -o $@ --img_bl1=$(BL1) --img_ns_bl1u=$(NS_BL1U) - -prm_ptable.img: - for ptable in $(PTABLE_LST); do \ - PTABLE=$${ptable} SECTOR_SIZE=4096 SGDISK=./sgdisk bash -x generate_ptable.sh;\ - cp prm_ptable.img ptable-$${ptable}.img;\ - done - -.PHONY: clean -clean: - rm -f *.img l-loader.bin diff --git a/l-loader/l-loader.lds b/l-loader/l-loader.lds deleted file mode 100644 index 41eb16f5..00000000 --- a/l-loader/l-loader.lds +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014 Linaro Ltd. - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -SECTIONS -{ - . = 0xf9800800; - LLOADER_START = .; - - .text : - { - *(.text) - *(.rodata) - } - - .data ALIGN(4): - { - *(.data) - } - - . = ALIGN(4); - - .bss ALIGN(4): - { - *(.bss) - } - - LLOADER_BL1_BIN = 0xf9801000; -} diff --git a/l-loader/recovery-fastboot.bin b/l-loader/recovery-fastboot.bin Binary files differdeleted file mode 100755 index fe562622..00000000 --- a/l-loader/recovery-fastboot.bin +++ /dev/null diff --git a/l-loader/start.S b/l-loader/start.S deleted file mode 100644 index a0d838a3..00000000 --- a/l-loader/start.S +++ /dev/null @@ -1,100 +0,0 @@ - .text - -/* - * The head of l-loader is defined in below. - * struct l_loader_head { - * unsigned int first_instr; - * unsigned char magic[16]; @ BOOTMAGICNUMBER! - * unsigned int l_loader_start; - * unsigned int l_loader_end; - * }; - */ - -#define CPU0_CTRL_OFFSET 0x100 -#define CPU7_CTRL_OFFSET 0x800 -#define CPU0_RVBARADDR_OFFSET 0x158 -#define CPU7_RVBARADDR_OFFSET 0x858 - -#define CPU_CTRL_AARCH64_MODE (1 << 7) - -#define SC_PERIPH_CLKEN3 0x230 -#define SC_PERIPH_RSTDIS3 0x334 - .global _start -_start: - b reset -@ Android magic number: "BOOTMAGICNUMBER!" -android_magic: - .word 0x544f4f42 - .word 0x4947414d - .word 0x4d554e43 - .word 0x21524542 - .word LLOADER_START @ LLOADER_START in RAM - .word 0 @ LLOADER_END in RAM - -entries: - @ 5 entries with 7 words - .space 140 - - .align 7 - -reset: - ldr r8, =(0xf9800000 + 0x700) - str r0, [r8] @ download mode (1:usb,2:uart,0:boot) - - ldr r4, =0xf6504000 @ ACPU_CTRL register base - @ set RVBAR for cpu0 - ldr r5, =CPU0_RVBARADDR_OFFSET - ldr r6, =LLOADER_BL1_BIN - mov r6, r6, lsr #2 - str r6, [r4, r5] -1: - ldr r0, [r4, r5] - cmp r0, r6 - bne 1b - - mov r5, #CPU0_CTRL_OFFSET - mov r6, #CPU7_CTRL_OFFSET -2: - ldr r0, [r4, r5] @ Load ACPU_SC_CPUx_CTRL - orr r0, r0, #CPU_CTRL_AARCH64_MODE - str r0, [r4, r5] @ Save to ACPU_SC_CPUx_CTRL - ldr r0, [r4, r5] - - add r5, r5, #0x100 @ Iterate ACPU_SC_CPUx_CTRL - cmp r5, r6 - ble 2b - - /* - * Prepare UART2 & UART3 without baud rate initialization. - * So always output on UART0 in l-loader. - */ - ldr r4, =0xf70100e0 @ UART2_RXD IOMG register - mov r0, #0 - str r0, [r4] - str r0, [r4, #4] @ UART2_TXD IOMG register - ldr r0, [r4] - - ldr r4, =0xf7010188 @ UART3_RXD IOMG register - mov r0, #1 - str r0, [r4] - str r0, [r4, #4] @ UART3_TXD IOMG register - ldr r1, [r4] - - ldr r4, =0xf7030000 @ PERI_CTRL register base - @ By default, CLK_TXCO is the parent of CLK_UART3 in SC_CLK_SEL0 - - ldr r5, =SC_PERIPH_RSTDIS3 @ unreset - ldr r6, =SC_PERIPH_CLKEN3 @ enable PCLK - mov r0, #(3 << 6) @ bit'6' & bit'7' (UART2 & UART3) - str r0, [r4, r5] - str r0, [r4, r6] - - @ execute warm reset to switch aarch64 - mov r2, #3 - mcr p15, 0, r2, c12, c0, 2 - wfi -panic: - b panic - -str_aarch64: - .asciz "\nSwitch to aarch64 mode. CPU0 executes at 0x" diff --git a/libmemtrack/Android.mk b/libmemtrack/Android.mk deleted file mode 100644 index 629a5d6e..00000000 --- a/libmemtrack/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2017 The Android Open Source Project -# -# 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. - -LOCAL_PATH := $(call my-dir) - -# HAL module implemenation stored in -# hw/<POWERS_HARDWARE_MODULE_ID>.<ro.hardware>.so -include $(CLEAR_VARS) - -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_PROPRIETARY_MODULE := true -LOCAL_C_INCLUDES += hardware/libhardware/include -LOCAL_CFLAGS := -Wconversion -Wall -Werror -Wno-sign-conversion -LOCAL_CLANG := true -LOCAL_SHARED_LIBRARIES := liblog libhardware -LOCAL_SRC_FILES := memtrack_hikey.c -LOCAL_MODULE := memtrack.default -#LOCAL_MODULE := memtrack.$(TARGET_BOARD_PLATFORM) -include $(BUILD_SHARED_LIBRARY) diff --git a/libmemtrack/memtrack_hikey.c b/libmemtrack/memtrack_hikey.c deleted file mode 100644 index d2ff1966..00000000 --- a/libmemtrack/memtrack_hikey.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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 <errno.h> - -#include <hardware/memtrack.h> - -int hikey_memtrack_init(const struct memtrack_module *module) -{ - if (!module) - return -1; - - return 0; -} - -static struct hw_module_methods_t memtrack_module_methods = { - .open = NULL, -}; - -struct memtrack_module HAL_MODULE_INFO_SYM = { - .common = { - .tag = HARDWARE_MODULE_TAG, - .module_api_version = MEMTRACK_MODULE_API_VERSION_0_1, - .hal_api_version = HARDWARE_HAL_API_VERSION, - .id = MEMTRACK_HARDWARE_MODULE_ID, - .name = "HiKey Memory Tracker HAL", - .author = "The Android Open Source Project", - .methods = &memtrack_module_methods, - }, - - .init = hikey_memtrack_init, -}; diff --git a/mali/Android.mk b/mali/Android.mk deleted file mode 100644 index 40604835..00000000 --- a/mali/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2015 The Android Open-Source Project -# -# 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. -# - -# WARNING: Everything listed here will be built on ALL platforms, -# including x86, the emulator, and the SDK. Modules must be uniquely -# named (liblights.panda), and must build everywhere, or limit themselves -# to only building on ARM if they include assembly. Individual makefiles -# are responsible for having their own logic, for fine-grained control. - -ifneq ($(filter hikey%, $(TARGET_DEVICE)),) - -LOCAL_PATH := $(call my-dir) - -# if some modules are built directly from this directory (not subdirectories), -# their rules should be written here. - -include $(call all-makefiles-under,$(LOCAL_PATH)) -endif diff --git a/mali/bifrost/APACHE_LICENSE.txt b/mali/bifrost/APACHE_LICENSE.txt deleted file mode 100644 index d6456956..00000000 --- a/mali/bifrost/APACHE_LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/mali/bifrost/Android.mk b/mali/bifrost/Android.mk deleted file mode 100644 index 4ea05a7e..00000000 --- a/mali/bifrost/Android.mk +++ /dev/null @@ -1,77 +0,0 @@ -ifneq ($(filter hikey960, $(TARGET_DEVICE)),) -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := END_USER_LICENCE_AGREEMENT.txt -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := $(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR) -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libGLES_mali.so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := lib/egl/$(LOCAL_MODULE) -LOCAL_SRC_FILES_arm64 := lib64/egl/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/egl/ -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/egl/ -LOCAL_MULTILIB := both -LOCAL_SHARED_LIBRARIES := android.hardware.graphics.common@1.0 libz libnativewindow libc++ liblog libm libc libdl -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libbccArm.so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/ -LOCAL_MULTILIB := 64 -# Bypass prebuilt ELF check because libLLVM is not a module (it is copied by -# PRODUCT_COPY_FILES instead). -LOCAL_CHECK_ELF_FILES := false -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libRSDriverArm.so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := lib/$(LOCAL_MODULE) -LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/ -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/ -LOCAL_MULTILIB := both -LOCAL_SHARED_LIBRARIES := libRS_internal libRSCpuRef liblog libnativewindow libbcinfo libdl libc++ libc libm -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libmalicore.bc -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := lib/$(LOCAL_MODULE) -LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/ -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/ -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := vulkan.hikey960.so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := lib/hw/$(LOCAL_MODULE) -LOCAL_SRC_FILES_arm64 := lib64/hw/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/hw -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/hw -LOCAL_MULTILIB := both -LOCAL_SHARED_LIBRARIES := android.hardware.graphics.common@1.0 libz libnativewindow libc++ liblog libm libc libdl -# Bypass prebuilt ELF check because the DT_SONAME "libGLES_mali.so" is -# different from LOCAL_MODULE "vulkan.hikey960.so". -LOCAL_CHECK_ELF_FILES := false -include $(BUILD_PREBUILT) - -endif - - diff --git a/mali/bifrost/END_USER_LICENCE_AGREEMENT.txt b/mali/bifrost/END_USER_LICENCE_AGREEMENT.txt deleted file mode 100644 index 34da5f85..00000000 --- a/mali/bifrost/END_USER_LICENCE_AGREEMENT.txt +++ /dev/null @@ -1,194 +0,0 @@ -LES-PRE-20769
-SP-Version: 1.0
-25 November 2015
-
-END USER LICENCE AGREEMENT FOR THE MALI USERSPACE DRIVER ("Mali DRIVER")
-
-THIS END USER LICENCE AGREEMENT ("LICENCE") IS A LEGAL AGREEMENT
-BETWEEN YOU (EITHER A SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND
-ARM LIMITED ("ARM") FOR THE USE OF THE SOFTWARE ACCOMPANYING THIS
-LICENCE. ARM IS ONLY WILLING TO LICENSE THE SOFTWARE TO YOU ON
-CONDITION THAT YOU ACCEPT ALL OF THE TERMS IN THIS LICENCE. BY
-INSTALLING OR OTHERWISE USING OR COPYING THE SOFTWARE YOU INDICATE
-THAT YOU AGREE TO BE BOUND BY ALL OF THE TERMS OF THIS LICENCE. IF YOU
-DO NOT AGREE TO THE TERMS OF THIS LICENCE, ARM IS UNWILLING TO LICENSE
-THE SOFTWARE TO YOU AND YOU MAY NOT INSTALL, USE OR COPY THE SOFTWARE,
-AND YOU SHOULD PROMPTLY RETURN THE SOFTWARE TO YOUR SUPPLIER.
-
-"Applications" means applications for use solely in conjunction with
-Mali-based products manufactured under licence from ARM.
-
-"Output" means data resulting from your use of the Software and all
-direct and indirect derivatives thereof.
-
-"Software" means any software, firmware and data accompanying this
-Licence, any printed, electronic or online documentation supplied with
-it under the terms of this Licence for the Mali Driver.
-
-1. LICENCE GRANTS TO YOU.
-
-1.1 ARM hereby grants to you, subject to the terms and conditions of
-this Licence, a non-exclusive, non-transferable, revocable, worldwide
-licence to:
-
-(i) use and copy the Software or certain components or optional
- functionality in the Software, as applicable, solely for the
- purposes of running, designing or developing Applications; and
-
-(ii) subject to Clause 1.2, distribute the whole of the Software;
- and/or (b) the whole or any part of the Software together
- with, or as incorporated into, Applications; and
-
-1.2 If you choose to redistribute the whole or any part of the
-Software pursuant to the licences granted in Clause 1.1(ii), you
-agree: (i) not to use ARM's or any of its licensors names, logos or
-trademarks to market Applications; (ii) to retain any and all
-copyright notices and other notices (whether ARM's or its licensor's)
-which are included with the Software; and (iii) include a copy of this
-Licence with such redistribution.
-
-2. RESTRICTIONS ON USE OF THE SOFTWARE.
-
-BENCHMARKING: This Licence does not prevent you from using the
-Software for benchmarking purposes. However, you shall ensure that any
-and all benchmarking data relating to the Software, and any other
-results of your use or testing of the Software which are indicative of
-its performance, efficacy, reliability or quality, shall not be used
-to disparage ARM, its products or services, or in a manner that, in
-ARM's reasonable judgment, may diminish or otherwise damage the
-reputation of ARM.
-
-COPYRIGHT AND RESERVATION OF RIGHTS: The Software is owned by ARM or
-its licensors and is protected by copyright and other intellectual
-property laws and international treaties. The Software is licensed not
-sold. You acquire no rights to the Software other than as expressly
-provided by this Licence. You shall not remove from the Software any
-copyright notice or other notice and shall ensure that any such notice
-is reproduced in any copies of the whole or any part of the Software
-made by you or other permitted users.
-
-REVERSE ENGINEERING: Except to the extent that such activity is
-permitted by applicable law you shall not reverse engineer, decompile
-or disassemble any of the Software. If the Software was provided to
-you in Europe you shall not reverse engineer, decompile or disassemble
-any of the Software for the purposes of error correction.
-
-RESTRICTED USE: You agree that you shall not use the Software or the
-Output other than pursuant to and in accordance with the exercise of
-any of the licences granted under this Licence. Without limiting the
-generality of the foregoing, you shall not use the Software or any
-Output: (a) for determining if any features, functions or processes
-provided by the Software are covered by any patents or patent
-applications owned by you or a third party; or (b) for developing
-technology, applications or products which avoid any of ARM's
-intellectual property in the Software licensed hereunder; or (c) as a
-reference for modifying existing patents or patent applications or
-creating any continuation, continuation in part, or extension of
-existing patents or patent applications.
-
-3. SUPPORT.
-
-ARM is not under an obligation to provide support, but it may do so at
-its own discretion, and if it does, it will only be in respect of the
-Software as delivered.
-
-4. NO WARRANTIES.
-
-YOU AGREE THAT THE SOFTWARE IS LICENSED "AS IS", AND THAT ARM
-EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS OR
-OTHER TERMS, EXPRESS OR IMPLIED OR STATUTORY, INCLUDING WITHOUT
-LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, SATISFACTORY
-QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-
-YOU EXPRESSLY ASSUME ALL LIABILITIES AND RISKS, FOR USE OR OPERATION
-OF APPLICATIONS, INCLUDING WITHOUT LIMITATION, APPLICATIONS DESIGNED
-OR INTENDED FOR MISSION CRITICAL APPLICATIONS, SUCH AS PACEMAKERS,
-WEAPONRY, AIRCRAFT NAVIGATION, FACTORY CONTROL SYSTEMS, ETC. SHOULD
-THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-5. LIMITATION OF LIABILITY.
-
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
-ARM BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
-DAMAGES (INCLUDING LOSS OF PROFITS) ARISING OUT OF THE USE OR
-INABILITY TO USE THE SOFTWARE WHETHER BASED ON A CLAIM UNDER CONTRACT,
-TORT OR OTHER LEGAL THEORY, EVEN IF ARM WAS ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-
-ARM does not seek to limit or exclude liability for death or personal
-injury arising from ARM's negligence or ARM's fraud and because some
-jurisdictions do not permit the exclusion or limitation of liability
-for consequential or incidental damages the above limitation relating
-to liability for consequential damages may not apply to you.
-
-NOTWITHSTANDING ANYTHING TO THE CONTRARY CONTAINED IN THIS LICENCE,
-THE MAXIMUM LIABILITY OF ARM TO YOU IN AGGREGATE FOR ALL CLAIMS MADE
-AGAINST ARM IN CONTRACT TORT OR OTHERWISE UNDER OR IN CONNECTION WITH
-THE SUBJECT MATTER OF THIS LICENCE SHALL NOT EXCEED THE GREATER OF:
-(I) THE TOTAL OF SUMS PAID BY YOU TO ARM (IF ANY) FOR THIS LICENCE;
-AND (II) $10.00 USD. THE EXISTENCE OF MORE THAN ONE CLAIM WILL NOT
-ENLARGE OR EXTEND THE LIMIT.
-
-6. U.S. GOVERNMENT END USERS.
-
-US Government Restrictions: Use, duplication, reproduction, release,
-modification, disclosure or transfer of the Software is restricted in
-accordance with the terms of this Licence.
-
-7. TERM AND TERMINATION.
-
-This Licence shall remain in force until terminated by you or by ARM.
-Without prejudice to any of its other rights if you are in breach of
-any of the terms and conditions of this Licence then ARM may terminate
-this Licence immediately upon giving written notice to you or on
-thirty (30) days written notice without cause. You may terminate this
-Licence at any time. Upon termination of this Licence by you or by ARM
-, you shall stop using the Software and destroy all copies of the
-Software in your possession, together with all documentation and
-related materials. The provisions of clauses 2, 3, 4, 5, 6, 7, and 8
-shall survive termination of this Licence.
-
-8. GENERAL.
-
-This Licence is governed by English Law. Except where ARM agrees
-otherwise in: (i) a written contract signed by you and ARM; or (ii) a
-written contract provided by ARM and accepted by you, this is the only
-agreement between you and ARM relating to the Software and it may only
-be modified by written agreement between you and ARM. Except as
-expressly agreed in writing, this Licence may not be modified by
-purchase orders, advertising or other representation by any person. If
-any clause or sentence in this Licence is held by a court of law to be
-illegal or unenforceable the remaining provisions of this Licence
-shall not be affected thereby. The failure by ARM to enforce any of
-the provisions of this Licence, unless waived in writing, shall not
-constitute a waiver of ARM's rights to enforce such provision or any
-other provision of this Licence in the future.
-
-At ARM's request, you agree to check your computers for installations
-of the Software and any other information requested by ARM relating to
-Software installation and to provide this information to ARM. You
-agree that auditors nominated by ARM may also perform such checking
-and reporting on behalf of ARM by prior appointment during your normal
-business hours on seven (7) days' notice. ARM shall bear the auditors'
-costs for that audit unless it reveals unlicensed usage in which case
-you shall promptly reimburse ARM for all reasonable costs and
-expenses, including professional fees, relating to such audit. Any
-information which is disclosed to ARM or such auditors during checking
-or audit shall be treated as your confidential information and shall
-only be used by ARM for licence management, compliance and enforcement
-purposes.
-
-The Software provided under this Agreement is subject to U.K.,
-European Union, and U.S. export control laws and regulations,
-including the U.S. Export Administration Act and its associated
-regulations (hereafter collectively referred to as "Export
-Regulations"). LICENSEE agrees to comply fully with all such Export
-Regulations and LICENSEE agrees that it shall not, either directly or
-indirectly, export in breach of the Export Regulations, any Software
-received under this Agreement, nor any direct products thereof; (i) to
-any country, company or person subject to export restrictions or
-sanctions under the Export Regulations; or (ii) for any prohibited end
-use, which at the time of export requires an export license or other
-governmental approval, without first obtaining such license or
-approval.
diff --git a/mali/bifrost/bin/bcc b/mali/bifrost/bin/bcc Binary files differdeleted file mode 100755 index c828bcaf..00000000 --- a/mali/bifrost/bin/bcc +++ /dev/null diff --git a/mali/bifrost/lib/egl/libGLES_mali.so b/mali/bifrost/lib/egl/libGLES_mali.so Binary files differdeleted file mode 100755 index 092d472f..00000000 --- a/mali/bifrost/lib/egl/libGLES_mali.so +++ /dev/null diff --git a/mali/bifrost/lib/hw/vulkan.hikey960.so b/mali/bifrost/lib/hw/vulkan.hikey960.so deleted file mode 120000 index 57c186c5..00000000 --- a/mali/bifrost/lib/hw/vulkan.hikey960.so +++ /dev/null @@ -1 +0,0 @@ -../egl/libGLES_mali.so
\ No newline at end of file diff --git a/mali/bifrost/lib/libRSDriverArm.so b/mali/bifrost/lib/libRSDriverArm.so Binary files differdeleted file mode 100755 index 721e324b..00000000 --- a/mali/bifrost/lib/libRSDriverArm.so +++ /dev/null diff --git a/mali/bifrost/lib/libclcore.bc b/mali/bifrost/lib/libclcore.bc Binary files differdeleted file mode 100644 index ee0429ad..00000000 --- a/mali/bifrost/lib/libclcore.bc +++ /dev/null diff --git a/mali/bifrost/lib/libclcore_neon.bc b/mali/bifrost/lib/libclcore_neon.bc Binary files differdeleted file mode 100644 index ce3da693..00000000 --- a/mali/bifrost/lib/libclcore_neon.bc +++ /dev/null diff --git a/mali/bifrost/lib/libmalicore.bc b/mali/bifrost/lib/libmalicore.bc Binary files differdeleted file mode 100644 index 5901017e..00000000 --- a/mali/bifrost/lib/libmalicore.bc +++ /dev/null diff --git a/mali/bifrost/lib64/egl/libGLES_mali.so b/mali/bifrost/lib64/egl/libGLES_mali.so Binary files differdeleted file mode 100755 index 19c41f1d..00000000 --- a/mali/bifrost/lib64/egl/libGLES_mali.so +++ /dev/null diff --git a/mali/bifrost/lib64/hw/vulkan.hikey960.so b/mali/bifrost/lib64/hw/vulkan.hikey960.so deleted file mode 120000 index 57c186c5..00000000 --- a/mali/bifrost/lib64/hw/vulkan.hikey960.so +++ /dev/null @@ -1 +0,0 @@ -../egl/libGLES_mali.so
\ No newline at end of file diff --git a/mali/bifrost/lib64/libLLVM.so b/mali/bifrost/lib64/libLLVM.so Binary files differdeleted file mode 100755 index 894b1d1c..00000000 --- a/mali/bifrost/lib64/libLLVM.so +++ /dev/null diff --git a/mali/bifrost/lib64/libRSDriverArm.so b/mali/bifrost/lib64/libRSDriverArm.so Binary files differdeleted file mode 100755 index 0a10776d..00000000 --- a/mali/bifrost/lib64/libRSDriverArm.so +++ /dev/null diff --git a/mali/bifrost/lib64/libbcc.so b/mali/bifrost/lib64/libbcc.so Binary files differdeleted file mode 100755 index b95b141c..00000000 --- a/mali/bifrost/lib64/libbcc.so +++ /dev/null diff --git a/mali/bifrost/lib64/libbccArm.so b/mali/bifrost/lib64/libbccArm.so Binary files differdeleted file mode 100755 index 7fe1dfd3..00000000 --- a/mali/bifrost/lib64/libbccArm.so +++ /dev/null diff --git a/mali/bifrost/lib64/libclcore.bc b/mali/bifrost/lib64/libclcore.bc Binary files differdeleted file mode 100644 index ca3d10b8..00000000 --- a/mali/bifrost/lib64/libclcore.bc +++ /dev/null diff --git a/mali/bifrost/lib64/libmalicore.bc b/mali/bifrost/lib64/libmalicore.bc Binary files differdeleted file mode 100644 index f8c6d712..00000000 --- a/mali/bifrost/lib64/libmalicore.bc +++ /dev/null diff --git a/mali/utgard/Android.mk b/mali/utgard/Android.mk deleted file mode 100644 index 3e9ccec8..00000000 --- a/mali/utgard/Android.mk +++ /dev/null @@ -1,28 +0,0 @@ -ifneq ($(filter hikey hikey64 hikey32, $(TARGET_DEVICE)),) -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := END_USER_LICENCE_AGREEMENT.txt -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := $(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR) -LOCAL_MULTILIB := 32 -LOCAL_SHARED_LIBRARIES := libc++ libc libdl liblog libm -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libGLES_mali.so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_STRIP_MODULE := false -LOCAL_SRC_FILES_arm := lib/egl/$(LOCAL_MODULE) -LOCAL_SRC_FILES_arm64 := lib64/egl/$(LOCAL_MODULE) -LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/egl/ -LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/egl/ -LOCAL_MULTILIB := both -LOCAL_SHARED_LIBRARIES := libc++ libc libdl liblog libm -include $(BUILD_PREBUILT) - -endif - - diff --git a/mali/utgard/END_USER_LICENCE_AGREEMENT.txt b/mali/utgard/END_USER_LICENCE_AGREEMENT.txt deleted file mode 100644 index 34da5f85..00000000 --- a/mali/utgard/END_USER_LICENCE_AGREEMENT.txt +++ /dev/null @@ -1,194 +0,0 @@ -LES-PRE-20769
-SP-Version: 1.0
-25 November 2015
-
-END USER LICENCE AGREEMENT FOR THE MALI USERSPACE DRIVER ("Mali DRIVER")
-
-THIS END USER LICENCE AGREEMENT ("LICENCE") IS A LEGAL AGREEMENT
-BETWEEN YOU (EITHER A SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND
-ARM LIMITED ("ARM") FOR THE USE OF THE SOFTWARE ACCOMPANYING THIS
-LICENCE. ARM IS ONLY WILLING TO LICENSE THE SOFTWARE TO YOU ON
-CONDITION THAT YOU ACCEPT ALL OF THE TERMS IN THIS LICENCE. BY
-INSTALLING OR OTHERWISE USING OR COPYING THE SOFTWARE YOU INDICATE
-THAT YOU AGREE TO BE BOUND BY ALL OF THE TERMS OF THIS LICENCE. IF YOU
-DO NOT AGREE TO THE TERMS OF THIS LICENCE, ARM IS UNWILLING TO LICENSE
-THE SOFTWARE TO YOU AND YOU MAY NOT INSTALL, USE OR COPY THE SOFTWARE,
-AND YOU SHOULD PROMPTLY RETURN THE SOFTWARE TO YOUR SUPPLIER.
-
-"Applications" means applications for use solely in conjunction with
-Mali-based products manufactured under licence from ARM.
-
-"Output" means data resulting from your use of the Software and all
-direct and indirect derivatives thereof.
-
-"Software" means any software, firmware and data accompanying this
-Licence, any printed, electronic or online documentation supplied with
-it under the terms of this Licence for the Mali Driver.
-
-1. LICENCE GRANTS TO YOU.
-
-1.1 ARM hereby grants to you, subject to the terms and conditions of
-this Licence, a non-exclusive, non-transferable, revocable, worldwide
-licence to:
-
-(i) use and copy the Software or certain components or optional
- functionality in the Software, as applicable, solely for the
- purposes of running, designing or developing Applications; and
-
-(ii) subject to Clause 1.2, distribute the whole of the Software;
- and/or (b) the whole or any part of the Software together
- with, or as incorporated into, Applications; and
-
-1.2 If you choose to redistribute the whole or any part of the
-Software pursuant to the licences granted in Clause 1.1(ii), you
-agree: (i) not to use ARM's or any of its licensors names, logos or
-trademarks to market Applications; (ii) to retain any and all
-copyright notices and other notices (whether ARM's or its licensor's)
-which are included with the Software; and (iii) include a copy of this
-Licence with such redistribution.
-
-2. RESTRICTIONS ON USE OF THE SOFTWARE.
-
-BENCHMARKING: This Licence does not prevent you from using the
-Software for benchmarking purposes. However, you shall ensure that any
-and all benchmarking data relating to the Software, and any other
-results of your use or testing of the Software which are indicative of
-its performance, efficacy, reliability or quality, shall not be used
-to disparage ARM, its products or services, or in a manner that, in
-ARM's reasonable judgment, may diminish or otherwise damage the
-reputation of ARM.
-
-COPYRIGHT AND RESERVATION OF RIGHTS: The Software is owned by ARM or
-its licensors and is protected by copyright and other intellectual
-property laws and international treaties. The Software is licensed not
-sold. You acquire no rights to the Software other than as expressly
-provided by this Licence. You shall not remove from the Software any
-copyright notice or other notice and shall ensure that any such notice
-is reproduced in any copies of the whole or any part of the Software
-made by you or other permitted users.
-
-REVERSE ENGINEERING: Except to the extent that such activity is
-permitted by applicable law you shall not reverse engineer, decompile
-or disassemble any of the Software. If the Software was provided to
-you in Europe you shall not reverse engineer, decompile or disassemble
-any of the Software for the purposes of error correction.
-
-RESTRICTED USE: You agree that you shall not use the Software or the
-Output other than pursuant to and in accordance with the exercise of
-any of the licences granted under this Licence. Without limiting the
-generality of the foregoing, you shall not use the Software or any
-Output: (a) for determining if any features, functions or processes
-provided by the Software are covered by any patents or patent
-applications owned by you or a third party; or (b) for developing
-technology, applications or products which avoid any of ARM's
-intellectual property in the Software licensed hereunder; or (c) as a
-reference for modifying existing patents or patent applications or
-creating any continuation, continuation in part, or extension of
-existing patents or patent applications.
-
-3. SUPPORT.
-
-ARM is not under an obligation to provide support, but it may do so at
-its own discretion, and if it does, it will only be in respect of the
-Software as delivered.
-
-4. NO WARRANTIES.
-
-YOU AGREE THAT THE SOFTWARE IS LICENSED "AS IS", AND THAT ARM
-EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS OR
-OTHER TERMS, EXPRESS OR IMPLIED OR STATUTORY, INCLUDING WITHOUT
-LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, SATISFACTORY
-QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE.
-
-YOU EXPRESSLY ASSUME ALL LIABILITIES AND RISKS, FOR USE OR OPERATION
-OF APPLICATIONS, INCLUDING WITHOUT LIMITATION, APPLICATIONS DESIGNED
-OR INTENDED FOR MISSION CRITICAL APPLICATIONS, SUCH AS PACEMAKERS,
-WEAPONRY, AIRCRAFT NAVIGATION, FACTORY CONTROL SYSTEMS, ETC. SHOULD
-THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-5. LIMITATION OF LIABILITY.
-
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
-ARM BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
-DAMAGES (INCLUDING LOSS OF PROFITS) ARISING OUT OF THE USE OR
-INABILITY TO USE THE SOFTWARE WHETHER BASED ON A CLAIM UNDER CONTRACT,
-TORT OR OTHER LEGAL THEORY, EVEN IF ARM WAS ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-
-ARM does not seek to limit or exclude liability for death or personal
-injury arising from ARM's negligence or ARM's fraud and because some
-jurisdictions do not permit the exclusion or limitation of liability
-for consequential or incidental damages the above limitation relating
-to liability for consequential damages may not apply to you.
-
-NOTWITHSTANDING ANYTHING TO THE CONTRARY CONTAINED IN THIS LICENCE,
-THE MAXIMUM LIABILITY OF ARM TO YOU IN AGGREGATE FOR ALL CLAIMS MADE
-AGAINST ARM IN CONTRACT TORT OR OTHERWISE UNDER OR IN CONNECTION WITH
-THE SUBJECT MATTER OF THIS LICENCE SHALL NOT EXCEED THE GREATER OF:
-(I) THE TOTAL OF SUMS PAID BY YOU TO ARM (IF ANY) FOR THIS LICENCE;
-AND (II) $10.00 USD. THE EXISTENCE OF MORE THAN ONE CLAIM WILL NOT
-ENLARGE OR EXTEND THE LIMIT.
-
-6. U.S. GOVERNMENT END USERS.
-
-US Government Restrictions: Use, duplication, reproduction, release,
-modification, disclosure or transfer of the Software is restricted in
-accordance with the terms of this Licence.
-
-7. TERM AND TERMINATION.
-
-This Licence shall remain in force until terminated by you or by ARM.
-Without prejudice to any of its other rights if you are in breach of
-any of the terms and conditions of this Licence then ARM may terminate
-this Licence immediately upon giving written notice to you or on
-thirty (30) days written notice without cause. You may terminate this
-Licence at any time. Upon termination of this Licence by you or by ARM
-, you shall stop using the Software and destroy all copies of the
-Software in your possession, together with all documentation and
-related materials. The provisions of clauses 2, 3, 4, 5, 6, 7, and 8
-shall survive termination of this Licence.
-
-8. GENERAL.
-
-This Licence is governed by English Law. Except where ARM agrees
-otherwise in: (i) a written contract signed by you and ARM; or (ii) a
-written contract provided by ARM and accepted by you, this is the only
-agreement between you and ARM relating to the Software and it may only
-be modified by written agreement between you and ARM. Except as
-expressly agreed in writing, this Licence may not be modified by
-purchase orders, advertising or other representation by any person. If
-any clause or sentence in this Licence is held by a court of law to be
-illegal or unenforceable the remaining provisions of this Licence
-shall not be affected thereby. The failure by ARM to enforce any of
-the provisions of this Licence, unless waived in writing, shall not
-constitute a waiver of ARM's rights to enforce such provision or any
-other provision of this Licence in the future.
-
-At ARM's request, you agree to check your computers for installations
-of the Software and any other information requested by ARM relating to
-Software installation and to provide this information to ARM. You
-agree that auditors nominated by ARM may also perform such checking
-and reporting on behalf of ARM by prior appointment during your normal
-business hours on seven (7) days' notice. ARM shall bear the auditors'
-costs for that audit unless it reveals unlicensed usage in which case
-you shall promptly reimburse ARM for all reasonable costs and
-expenses, including professional fees, relating to such audit. Any
-information which is disclosed to ARM or such auditors during checking
-or audit shall be treated as your confidential information and shall
-only be used by ARM for licence management, compliance and enforcement
-purposes.
-
-The Software provided under this Agreement is subject to U.K.,
-European Union, and U.S. export control laws and regulations,
-including the U.S. Export Administration Act and its associated
-regulations (hereafter collectively referred to as "Export
-Regulations"). LICENSEE agrees to comply fully with all such Export
-Regulations and LICENSEE agrees that it shall not, either directly or
-indirectly, export in breach of the Export Regulations, any Software
-received under this Agreement, nor any direct products thereof; (i) to
-any country, company or person subject to export restrictions or
-sanctions under the Export Regulations; or (ii) for any prohibited end
-use, which at the time of export requires an export license or other
-governmental approval, without first obtaining such license or
-approval.
diff --git a/mali/utgard/lib/egl/libGLES_mali.so b/mali/utgard/lib/egl/libGLES_mali.so Binary files differdeleted file mode 100755 index f86da7e5..00000000 --- a/mali/utgard/lib/egl/libGLES_mali.so +++ /dev/null diff --git a/mali/utgard/lib64/egl/libGLES_mali.so b/mali/utgard/lib64/egl/libGLES_mali.so Binary files differdeleted file mode 100755 index 5c0af47c..00000000 --- a/mali/utgard/lib64/egl/libGLES_mali.so +++ /dev/null diff --git a/manifest.xml b/manifest.xml index e60aa9cc..91e16b97 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,8 +1,8 @@ -<manifest version="1.0" type="device" target-level="2"> +<manifest version="1.0" type="device" target-level="6"> <hal format="hidl"> <name>android.hardware.audio</name> <transport>hwbinder</transport> - <version>4.0</version> + <version>7.0</version> <interface> <name>IDevicesFactory</name> <instance>default</instance> @@ -11,7 +11,7 @@ <hal format="hidl"> <name>android.hardware.audio.effect</name> <transport>hwbinder</transport> - <version>4.0</version> + <version>7.0</version> <interface> <name>IEffectsFactory</name> <instance>default</instance> @@ -41,18 +41,9 @@ <version>1.0</version> </hal> <hal format="hidl"> - <name>android.hardware.configstore</name> - <transport>hwbinder</transport> - <version>1.1</version> - <interface> - <name>ISurfaceFlingerConfigs</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>android.hardware.drm</name> <transport>hwbinder</transport> - <version>1.0</version> + <version>1.3</version> <interface> <name>ICryptoFactory</name> <instance>default</instance> @@ -63,15 +54,6 @@ </interface> </hal> <hal format="hidl"> - <name>android.hardware.gnss</name> - <transport arch="32+64">passthrough</transport> - <version>1.0</version> - <interface> - <name>IGnss</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>android.hardware.graphics.allocator</name> <transport>hwbinder</transport> <version>2.0</version> @@ -92,7 +74,7 @@ <hal format="hidl"> <name>android.hardware.graphics.mapper</name> <transport arch="32+64">passthrough</transport> - <version>2.0</version> + <version>2.1</version> <interface> <name>IMapper</name> <instance>default</instance> @@ -121,33 +103,6 @@ </interface> </hal> <hal format="hidl"> - <name>android.hardware.memtrack</name> - <transport>hwbinder</transport> - <version>1.0</version> - <interface> - <name>IMemtrack</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> - <name>android.hardware.power</name> - <transport>hwbinder</transport> - <version>1.1</version> - <interface> - <name>IPower</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> - <name>android.hardware.soundtrigger</name> - <transport arch="32">passthrough</transport> - <version>2.0</version> - <interface> - <name>ISoundTriggerHw</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>android.hardware.renderscript</name> <transport arch="32+64">passthrough</transport> <version>1.0</version> @@ -157,11 +112,11 @@ </interface> </hal> <hal format="hidl"> - <name>android.hardware.health</name> + <name>android.hardware.soundtrigger</name> <transport>hwbinder</transport> - <version>2.0</version> + <version>2.3</version> <interface> - <name>IHealth</name> + <name>ISoundTriggerHw</name> <instance>default</instance> </interface> </hal> diff --git a/power/Android.mk b/power/Android.mk index 76ff7893..0e08d0a8 100644 --- a/power/Android.mk +++ b/power/Android.mk @@ -24,6 +24,8 @@ LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_MODULE := android.hardware.power@1.1-service.hikey-common +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD +LOCAL_LICENSE_CONDITIONS := notice LOCAL_INIT_RC := android.hardware.power@1.1-service.hikey-common.rc LOCAL_SRC_FILES := service.cpp Power.cpp power_hikey.c diff --git a/recovery/Android.bp b/recovery/Android.bp index 0fd89068..c4b8df0b 100644 --- a/recovery/Android.bp +++ b/recovery/Android.bp @@ -14,6 +14,15 @@ // limitations under the License. // +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_linaro_hikey_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["device_linaro_hikey_license"], +} + cc_library_static { name: "librecovery_ui_hikey", owner: "linaro", diff --git a/self-extractors_hikey960/root/BoardConfigVendor.mk b/self-extractors_hikey960/root/BoardConfigVendor.mk index 1517386a..e70a67dd 100644 --- a/self-extractors_hikey960/root/BoardConfigVendor.mk +++ b/self-extractors_hikey960/root/BoardConfigVendor.mk @@ -12,6 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -LOCAL_STEM := hikey960/BoardConfigPartial.mk - --include vendor/linaro/$(LOCAL_STEM) +-include vendor/linaro/hikey960/BoardConfigPartial.mk diff --git a/self-extractors_hikey960/root/device-vendor.mk b/self-extractors_hikey960/root/device-vendor.mk index 31f5c3a3..f4fb1bb6 100644 --- a/self-extractors_hikey960/root/device-vendor.mk +++ b/self-extractors_hikey960/root/device-vendor.mk @@ -14,6 +14,4 @@ # limitations under the License. # -LOCAL_STEM := device-partial.mk - -$(call inherit-product-if-exists, vendor/linaro/hikey960/hisilicon/$(LOCAL_STEM)) +$(call inherit-product-if-exists, vendor/linaro/hikey960/hisilicon/device-partial.mk) diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 5c010f0c..9592d82e 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -13,13 +13,14 @@ /dev/hifi_misc u:object_r:audio_device:s0 /dev/hi_vdec u:object_r:video_device:s0 /dev/hi_venc u:object_r:video_device:s0 - +/dev/dma_heap/linux,cma u:object_r:dmabuf_cma_heap_device:s0 /dev/graphics/fb0 u:object_r:graphics_device:s0 # files in /vendor /(vendor|system/vendor)/bin/uim u:object_r:hci_attach_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.bluetooth@1\.0-service\.hikey u:object_r:hal_bluetooth_hikey_exec:s0 /(vendor|system/vendor)/bin/nanoapp_cmd u:object_r:nanoapp_cmd_exec:s0 +/(vendor|system/vendor)/bin/suspend_blocker u:object_r:suspend_blocker_exec:s0 /(vendor|system/vendor)/lib(64)?/hw/gralloc\.hikey960\.so u:object_r:same_process_hal_file:s0 /(vendor|system/vendor)/lib(64)?/hw/gralloc\.hikey\.so u:object_r:same_process_hal_file:s0 @@ -30,13 +31,19 @@ /sys/devices/platform/ddr_devfreq/devfreq/ddr_devfreq/min_freq u:object_r:sysfs_power:s0 /sys/devices/platform/e82c0000\.mali/devfreq/e82c0000\.mali/min_freq u:object_r:sysfs_power:s0 +# for HiKey Board /dev/block/platform/soc/f723d000\.dwmmc0/by-name/cache u:object_r:cache_block_device:s0 /dev/block/platform/soc/f723d000\.dwmmc0/by-name/userdata u:object_r:userdata_block_device:s0 +# for HiKey960 Board +/dev/block/platform/soc/ff3b0000\.ufs/by-name/cache u:object_r:metadata_block_device:s0 +/dev/block/platform/soc/ff3b0000\.ufs/by-name/userdata u:object_r:userdata_block_device:s0 + /vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service\.software u:object_r:hal_gatekeeper_default_exec:s0 /vendor/bin/hw/android\.hardware\.power@1\.1-service\.hikey-common u:object_r:hal_power_default_exec:s0 +/vendor/lib(64)?/hw/vulkan\.hikey960\.so u:object_r:same_process_hal_file:s0 /vendor/lib(64)?/libRSDriverArm\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libbccArm\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libbcc\.so u:object_r:same_process_hal_file:s0 diff --git a/sepolicy/hal_graphics_allocator_default.te b/sepolicy/hal_graphics_allocator_default.te index b17dc7d4..7f2b36bd 100644 --- a/sepolicy/hal_graphics_allocator_default.te +++ b/sepolicy/hal_graphics_allocator_default.te @@ -1,2 +1,6 @@ +type dmabuf_cma_heap_device, dmabuf_heap_device_type, dev_type; + allow hal_graphics_allocator_default graphics_device:dir search; allow hal_graphics_allocator_default graphics_device:chr_file { open read write ioctl map rw_file_perms}; +allow hal_graphics_allocator_default dmabuf_system_heap_device:chr_file r_file_perms; +allow hal_graphics_allocator_default dmabuf_cma_heap_device:chr_file r_file_perms; diff --git a/sepolicy/hal_memtrack.te b/sepolicy/hal_memtrack.te deleted file mode 100644 index c2da1245..00000000 --- a/sepolicy/hal_memtrack.te +++ /dev/null @@ -1,11 +0,0 @@ -type debugfs_kgsl, debugfs_type, fs_type; - -allow domain debugfs_kgsl:dir search; - -allow hal_memtrack debugfs_kgsl:dir search; -allow hal_memtrack debugfs_kgsl:file { open read getattr }; - -# Memtrack reads proc/<pid>/cmdline to check if process is surfaceflinger. -# Grant access if that's the case; don't log denials for other processes. -allow hal_memtrack surfaceflinger:file read; -dontaudit hal_memtrack { domain -surfaceflinger}:file read; diff --git a/sepolicy/property.te b/sepolicy/property.te index 93e029d4..c47a33e0 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -1 +1 @@ -type sensors_prop, property_type; +vendor_internal_prop(sensors_prop) diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts deleted file mode 100644 index 3a4bde3f..00000000 --- a/sepolicy/property_contexts +++ /dev/null @@ -1 +0,0 @@ -sensors. u:object_r:sensors_prop:s0 diff --git a/sepolicy/suspend_blocker.te b/sepolicy/suspend_blocker.te new file mode 100644 index 00000000..fa6e02a8 --- /dev/null +++ b/sepolicy/suspend_blocker.te @@ -0,0 +1,6 @@ +type suspend_blocker, domain; +type suspend_blocker_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(suspend_blocker); + +wakelock_use(suspend_blocker); diff --git a/uefi-tools/atf-build.sh b/uefi-tools/atf-build.sh deleted file mode 100755 index 65d4dbc6..00000000 --- a/uefi-tools/atf-build.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/bash -# -# Builds ARM Trusted Firmware, and generates FIPs with UEFI and optionally -# Trusted OS for the supported platforms. -# Not intended to be called directly, invoked from uefi-build.sh. -# -# Board configuration is extracted from -# parse-platforms.py and platforms.config. -# - -. "$TOOLS_DIR"/common-functions -OUTPUT_DIR="$PWD"/uefi-build - -ATF_BUILDVER=1 - -function usage -{ - echo "usage:" - echo "atf-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>" - echo -} - -function check_atf_buildver -{ - MAJOR=`grep "^VERSION_MAJOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` - [ $? -ne 0 ] && return 1 - MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'` - [ $? -ne 0 ] && return 1 - - if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then - ATF_BUILDVER=2 - fi -} - -function build_platform -{ - if [ X"$EDK2_DIR" = X"" ];then - echo "EDK2_DIR not set!" >&2 - return 1 - fi - - check_atf_buildver || return 1 - - BUILD_ATF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_atf`" - if [ X"$BUILD_ATF" = X"" ]; then - echo "Platform '$1' is not configured to build ARM Trusted Firmware." - return 0 - fi - - ATF_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`" - if [ X"$ATF_PLATFORM" = X"" ]; then - ATF_PLATFORM=$1 - fi - - # - # Read platform configuration - # - PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o longname`" - PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o arch`" - PLATFORM_IMAGE_DIR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_image_dir`" - PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_buildflags`" - - if [ $VERBOSE -eq 1 ]; then - echo "PLATFORM_NAME=$PLATFORM_NAME" - echo "PLATFORM_ARCH=$PLATFORM_ARCH" - echo "PLATFORM_IMAGE_DIR=$PLATFORM_IMAGE_DIR" - echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS" - fi - - unset BL30 BL31 BL32 BL33 - BL30="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o scp_bin`" - if [ $ATF_BUILDVER -gt 1 ]; then - unset SCP_BL2 - SCP_BL2=`search_packages_path "$BL30"` - fi - BL31="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o el3_bin`" - BL33="$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_bin`" - - # - # Set up cross compilation variables (if applicable) - # - set_cross_compile - CROSS_COMPILE="$TEMP_CROSS_COMPILE" - echo "Building ARM Trusted Firmware for $PLATFORM_NAME - $BUILD_PROFILE" - echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\"" - - if [ X"$BL30" != X"" ]; then - BL30=`search_packages_path "$BL30"` - fi - if [ X"$BL31" != X"" ]; then - BL31=`search_packages_path "$BL31"` - fi - - # - # BL32 requires more attention - # If TOS_DIR is not set, we assume user does not want a Trusted OS, - # even if the source directory and/or binary for it exists - # - if [ X"$TOS_DIR" != X"" ]; then - SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`" - - TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`" - if [ X"$TOS_BIN" != X"" ]; then - BL32=$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/$TOS_BIN - fi - - if [ X"$SPD" != X"" ] && [ X"$BL32" != X"" ]; then - # - # Since SPD cannot be exported or undefined, - # we parametrise it here - # - SPD_OPTION="SPD=$SPD" - else - echo "WARNING: Proceeding without Trusted OS!" - echo " Please specify both ATF_SPD and TOS_BIN" - echo " if you wish to use a Trusted OS!" - fi - else - # - # Since TOS_DIR is not set, user does not want a Trusted OS - # even if the source directory and/or binary for it exists. - # Next, Check whether user wants secure partition image. - # If SPM_BIN is set then include pre-built secure partition image as a - # BL32 Image and implicitly set SPM=1. - # - SPM_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o spm_bin`" - - if [ X"$SPM_BIN" != X"" ]; then - BL32=$WORKSPACE/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/$SPM_BIN - PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS SPM=1" - fi - # We assume that user does not want secure partition either. - # Todo: Revisit if either one of Trusted OS or Secure Partition Image is Mandatory. - fi - - - - # - # Debug extraction handling - # - case "$BUILD_ATF" in - debug*) - DEBUG=1 - BUILD_TYPE="debug" - ;; - *) - DEBUG=0 - BUILD_TYPE="release" - ;; - esac - - export BL30 BL31 BL32 BL33 - - echo "BL30=$BL30" - if [ $ATF_BUILDVER -gt 1 ] && [ X"$BL30" != X"" ]; then - export SCP_BL2 - echo "SCP_BL2=$BL30" - fi - echo "BL31=$BL31" - echo "BL32=$BL32" - echo "BL33=$BL33" - echo "$SPD_OPTION" - echo "BUILD_TYPE=$BUILD_TYPE" - - # - # If a build was done with BL32, and followed by another without, - # the BL32 component remains in fip.bin, so we delete the build dir - # contents before calling make - # - rm -rf build/"$ATF_PLATFORM/$BUILD_TYPE"/* - - # - # Build ARM Trusted Firmware and create FIP - # - if [ $VERBOSE -eq 1 ]; then - echo "Calling ARM Trusted Firmware build:" - echo "CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip" - fi - CROSS_COMPILE="$CROSS_COMPILE" make -j$NUM_THREADS PLAT="$ATF_PLATFORM" $SPD_OPTION DEBUG=$DEBUG ${PLATFORM_BUILDFLAGS} all fip - if [ $? -eq 0 ]; then - # - # Copy resulting images to UEFI image dir - # - if [ $VERBOSE -eq 1 ]; then - echo "Copying bl1.bin and fip.bin to "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/"" - fi - cp -a build/"$ATF_PLATFORM/$BUILD_TYPE"/{bl1,fip}.bin "$WORKSPACE/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" - else - return 1 - fi -} - -# Check to see if we are in a trusted firmware directory -# refuse to continue if we aren't -if [ ! -d bl32 ] -then - echo "ERROR: we aren't in the arm-trusted-firmware directory." - usage - exit 1 -fi - -build= - -if [ $# = 0 ] -then - usage - exit 1 -else - while [ "$1" != "" ]; do - case $1 in - "-e" ) - shift - EDK2_DIR="$1" - ;; - "/h" | "/?" | "-?" | "-h" | "--help" ) - usage - exit - ;; - "-t" ) - shift - BUILD_PROFILE="$1" - ;; - * ) - build="$1" - ;; - esac - shift - done -fi - -if [ X"$build" = X"" ]; then - echo "No platform specified!" >&2 - echo - usage - exit 1 -fi - -build_platform $build -exit $? diff --git a/uefi-tools/common-functions b/uefi-tools/common-functions deleted file mode 100644 index 9d01ae16..00000000 --- a/uefi-tools/common-functions +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/bash - -RESULT_BUF=`echo -e ------------------------------------------------------------` -RESULT_PASS_COUNT=0 -RESULT_FAIL_COUNT=0 - -function result_log -{ - if [ $1 -eq 0 ]; then - RESULT_BUF="`printf \"%s\n%55s\tpass\" \"$RESULT_BUF\" \"$2\"`" - RESULT_PASS_COUNT=$(($RESULT_PASS_COUNT + 1)) - else - RESULT_BUF="`printf \"%s\n%55s\tfail\" \"$RESULT_BUF\" \"$2\"`" - RESULT_FAIL_COUNT=$(($RESULT_FAIL_COUNT + 1)) - fi -} - -function result_print -{ - printf "%s" "$RESULT_BUF" - echo -e "\n------------------------------------------------------------" - printf "pass\t$RESULT_PASS_COUNT\n" - printf "fail\t$RESULT_FAIL_COUNT\n" - - exit $RESULT_FAIL_COUNT -} - -function get_build_arch -{ - case `uname -m` in - arm*) - BUILD_ARCH=ARM;; - aarch64*) - BUILD_ARCH=AARCH64;; - i?86*) - BUILD_ARCH=IA32;; - x86_64*) - BUILD_ARCH=X64;; - *) - BUILD_ARCH=other;; - esac -} - -function set_cross_compile -{ - get_build_arch - - echo "Target: $PLATFORM_ARCH" - echo "Build: $BUILD_ARCH" - if [ "$PLATFORM_ARCH" = "$BUILD_ARCH" ]; then - TEMP_CROSS_COMPILE= - else - case "$PLATFORM_ARCH" in - AARCH64) - if [ X"$CROSS_COMPILE_64" != X"" ]; then - TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" - else - TEMP_CROSS_COMPILE=aarch64-linux-gnu- - fi - ;; - ARM) - TEMP_CROSS_COMPILE=arm-linux-gnueabihf- ;; - IA32) - TEMP_CROSS_COMPILE=x86_64-linux-gnu- - for family in 6 5 4 3; do - if i$family86-linux-gnu-as -version >/dev/null 2>&1;then - TEMP_CROSS_COMPILE=i$family86-linux-gnu- - break - fi - done - ;; - X64) - TEMP_CROSS_COMPILE=x86_64-linux-gnu- ;; - *) - echo "Unsupported target architecture '$PLATFORM_ARCH'!" >&2 - ;; - esac - fi -} - -function get_gcc_version -{ - $1 -v >/dev/null 2>&1 || return 1 - gcc_version=$($1 -dumpversion) - MAJVER=`echo $gcc_version | cut -d. -f1` - - case $gcc_version in - 4*) - echo GCC$(echo ${gcc_version} | awk -F. '{print $1$2}') - ;; - *) - if [ "$MAJVER" -ge 5 ]; then - # We only have a GCC5 build profile for now, so... - # echo GCC$MAJVER - echo GCC5 - else - echo "Unknown toolchain version '$gcc_version'" >&2 - echo "Attempting to build using GCC49 profile." >&2 - echo GCC49 - fi - ;; - esac - - return 0 -} - -function get_clang_version -{ - clang_version=`$1 --version | head -1 | sed 's/^.*version\s*\([0-9]*\).\([0-9]*\).*/\1\2/g'` - case $clang_version in - 35*) - echo "CLANG$clang_version" - ;; - *) - echo "Unknown toolchain version '$clang_version'" >&2 - echo "Attempting to build using CLANG35 profile." >&2 - echo CLANG35 - ;; - esac -} - -function download_patch_openssl -{ - OPENSSL_VER=`ls EDKII_openssl-*.patch | sed 's/^.*-\([0-9.a-z]*\).patch/\1/'` - OPENSSL_TAR=openssl-${OPENSSL_VER}.tar.gz - OPENSSL_URL=http://www.openssl.org/source/${OPENSSL_TAR} - OPENSSL_DIR=openssl-${OPENSSL_VER} - OPENSSL_PATCH=EDKII_openssl-${OPENSSL_VER}.patch - - if [ -e "$WORKSPACE"/CryptoPkg/Include/openssl/opensslconf.h ]; then - echo "OpenSSL already imported!" - return 0 - fi - - # Use cached copy if available - if [ -f "$WORKSPACE"/LinaroPkg/"$OPENSSL_TAR" ]; then - tar xzf "$WORKSPACE"/LinaroPkg/"$OPENSSL_TAR" - else - wget -O - -q ${OPENSSL_URL} | tar xzf - - fi - - echo "Importing OpenSSL $OPENSSL_VER" - ( cd ${OPENSSL_DIR}; patch -p1 -i ../${OPENSSL_PATCH} ) - ./Install.sh - - if [ $? -eq 0 ]; then - OPENSSL_CONFIGURED=TRUE - else - echo "OpenSSL $OPENSSL_VER import failed!" >&2 - rm -rf $OPENSSL_TAR $OPENSSL_DIR - return 1 - fi -} - -function clone_process_openssl -{ - if [ -e openssl/include/openssl/opensslconf.h ]; then - echo "OpenSSL already imported!" - return 0 - fi - - OPENSSL_VER=`git ls-remote --tags git://github.com/openssl/openssl.git | awk '{print $2;}' | sed 's-^refs/tags/--g' | grep -v '\^{}$' | grep '^OpenSSL' | grep -v '^OpenSSL_FIPS' | tail -1 | sed -n 's/^OpenSSL_\([0-9]*\)_\([0-9]*\)_\([0-9.a-z]*\)$/openssl-\1.\2.\3\n/p'` - OPENSSL_TAR="$OPENSSL_VER.tar.gz" - if [ -z "$OPENSSL_TAR" ]; then - return 1 - fi - OPENSSL_URL=http://www.openssl.org/source/${OPENSSL_TAR} - if [ ! -f "$OPENSSL_TAR" ]; then - wget -q ${OPENSSL_URL} - else - rm -rf openssl - fi - tar xzf "$OPENSSL_TAR" - mv "$OPENSSL_VER" openssl - # perl process_files.pl # not needed and not currently working - return $? -} - -function import_openssl -{ - # Don't re-import if already done - if [ "$OPENSSL_CONFIGURED" = "TRUE" ]; then - echo "Using existing OpenSSL $OPENSSL_VER" - return 0 - fi - - cd CryptoPkg/Library/OpensslLib/ - if [ -f EDKII_openssl-*.patch ]; then - download_patch_openssl - else - clone_process_openssl - fi - RET=$? - cd - >/dev/null - return $RET -} - -function search_packages_path -{ - file="$1" - - IFS=: - for dir in $PACKAGES_PATH; do - if [ -e "$dir/$file" ]; then - echo "$dir/$file" - unset IFS - return 0 - fi - done - - echo "$file not found in any directory on PACKAGES_PATH!" >&2 - unset IFS - return 1 -} diff --git a/uefi-tools/edk2-build.sh b/uefi-tools/edk2-build.sh deleted file mode 100755 index 3e218b3c..00000000 --- a/uefi-tools/edk2-build.sh +++ /dev/null @@ -1,401 +0,0 @@ -#!/bin/bash - -# -# edk2-build.sh: evolution of uefi-build.sh for edk2-platforms -# - -unset MAKEFLAGS # BaseTools not safe to build parallel, prevent env overrides - -TOOLS_DIR="`dirname $0`" -TOOLS_DIR="`readlink -f \"$TOOLS_DIR\"`" -export TOOLS_DIR -. "$TOOLS_DIR"/common-functions -PLATFORM_CONFIG="-c $TOOLS_DIR/edk2-platforms.config" -ARCH= -VERBOSE=0 # Override with -v -ATF_DIR= -TOS_DIR= -TOOLCHAIN="gcc" # Override with -T -WORKSPACE= -EDK2_DIR= -PLATFORMS_DIR= -NON_OSI_DIR= -IMPORT_OPENSSL=TRUE -OPENSSL_CONFIGURED=FALSE - -# Number of threads to use for build -export NUM_THREADS=$((`getconf _NPROCESSORS_ONLN` + `getconf _NPROCESSORS_ONLN`)) - -function do_build -{ - PLATFORM_ARCH=`echo $board | cut -s -d: -f2` - if [ -n "$PLATFORM_ARCH" ]; then - board=`echo $board | cut -d: -f1` - else - PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o arch`" - fi - PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname` ($PLATFORM_ARCH)" - if [ -z "$PLATFORM_ARCH" ]; then - echo "Unknown target architecture - aborting!" >&2 - return 1 - fi - PLATFORM_PREBUILD_CMDS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o prebuild_cmds`" - PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildflags`" - PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS ${EXTRA_OPTIONS[@]}" - PLATFORM_BUILDCMD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildcmd`" - PLATFORM_DSC="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o dsc`" - PLATFORM_PACKAGES_PATH="" - COMPONENT_INF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o inf`" - - TEMP_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o packages_path`" - IFS=: - for path in "$TEMP_PACKAGES_PATH"; do - case "$path" in - /*) - PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$path" - ;; - *) - PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$PWD/$path" - ;; - esac - done - unset IFS - - if [ $VERBOSE -eq 1 ]; then - echo "Setting build parallellism to $NUM_THREADS processes" - echo "PLATFORM_NAME=$PLATFORM_NAME" - echo "PLATFORM_PREBUILD_CMDS=$PLATFORM_PREBUILD_CMDS" - echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS" - echo "PLATFORM_BUILDCMD=$PLATFORM_BUILDCMD" - echo "PLATFORM_DSC=$PLATFORM_DSC" - echo "PLATFORM_ARCH=$PLATFORM_ARCH" - echo "PLATFORM_PACKAGES_PATH=$PLATFORM_PACKAGES_PATH" - fi - - set_cross_compile - CROSS_COMPILE="$TEMP_CROSS_COMPILE" - - echo "Building $PLATFORM_NAME - $PLATFORM_ARCH" - echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\"" - echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'" - - if [ "$TARGETS" == "" ]; then - TARGETS=( RELEASE ) - fi - - case $TOOLCHAIN in - "gcc") - PLATFORM_TOOLCHAIN=`get_gcc_version "$CROSS_COMPILE"gcc` - ;; - "clang") - PLATFORM_TOOLCHAIN=`get_clang_version clang` - ;; - *) - # Use command-line specified profile directly - PLATFORM_TOOLCHAIN=$TOOLCHAIN - ;; - esac - echo "PLATFORM_TOOLCHAIN is ${PLATFORM_TOOLCHAIN}" - - export ${PLATFORM_TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE - echo "Toolchain prefix: ${PLATFORM_TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE" - - export PACKAGES_PATH="$PLATFORM_PACKAGES_PATH" - for target in "${TARGETS[@]}" ; do - if [ X"$PLATFORM_PREBUILD_CMDS" != X"" ]; then - echo "Run pre-build commands:" - if [ $VERBOSE -eq 1 ]; then - echo " ${PLATFORM_PREBUILD_CMDS}" - fi - eval ${PLATFORM_PREBUILD_CMDS} - fi - - if [ -n "$COMPONENT_INF" ]; then - # Build a standalone component - if [ $VERBOSE -eq 1 ]; then - echo "build -n $NUM_THREADS -a \"$PLATFORM_ARCH\" -t ${PLATFORM_TOOLCHAIN} -p \"$PLATFORM_DSC\"" \ - "-m \"$COMPONENT_INF\" -b "$target" ${PLATFORM_BUILDFLAGS}" - fi - build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${PLATFORM_TOOLCHAIN} -p "$PLATFORM_DSC" \ - -m "$COMPONENT_INF" -b "$target" ${PLATFORM_BUILDFLAGS} - else - # Build a platform - if [ $VERBOSE -eq 1 ]; then - echo "build -n $NUM_THREADS -a \"$PLATFORM_ARCH\" -t ${PLATFORM_TOOLCHAIN} -p \"$PLATFORM_DSC\"" \ - "-b "$target" ${PLATFORM_BUILDFLAGS}" - fi - build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${PLATFORM_TOOLCHAIN} -p "$PLATFORM_DSC" \ - -b "$target" ${PLATFORM_BUILDFLAGS} - fi - - RESULT=$? - if [ $RESULT -eq 0 ]; then - if [ X"$TOS_DIR" != X"" ]; then - pushd $TOS_DIR >/dev/null - if [ $VERBOSE -eq 1 ]; then - echo "$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board" - fi - $TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board - RESULT=$? - popd >/dev/null - fi - fi - if [ $RESULT -eq 0 ]; then - if [ X"$ATF_DIR" != X"" ]; then - pushd $ATF_DIR >/dev/null - if [ $VERBOSE -eq 1 ]; then - echo "$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board" - fi - $TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${PLATFORM_TOOLCHAIN} $board - RESULT=$? - popd >/dev/null - fi - fi - result_log $RESULT "$PLATFORM_NAME $target" - done - unset PACKAGES_PATH -} - - -function configure_paths -{ - WORKSPACE="$PWD" - - # Check to see if we are in a UEFI repository - # refuse to continue if we aren't - if [ ! -d "$EDK2_DIR"/BaseTools ] - then - if [ -d "$PWD"/edk2/BaseTools ]; then - EDK2_DIR="$PWD"/edk2 - else - echo "ERROR: can't locate the edk2 directory" >&2 - echo " please specify -e/--edk2-dir" >&2 - exit 1 - fi - fi - - GLOBAL_PACKAGES_PATH="$EDK2_DIR" - - # locate edk2-platforms - if [ -z "$PLATFORMS_DIR" -a -d "$PWD"/edk2-platforms ]; then - PLATFORMS_DIR="$PWD"/edk2-platforms - fi - if [ -n "$PLATFORMS_DIR" ]; then - GLOBAL_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:$PLATFORMS_DIR" - fi - - # locate edk2-non-osi - if [ -z "$NON_OSI_DIR" -a -d "$PWD"/edk2-non-osi ]; then - NON_OSI_DIR="$PWD"/edk2-non-osi - fi - if [ -n "$NON_OSI_DIR" ]; then - GLOBAL_PACKAGES_PATH="$GLOBAL_PACKAGES_PATH:$NON_OSI_DIR" - fi - - # locate arm-trusted-firmware - if [ -z "$ATF_DIR" -a -d "$PWD"/arm-trusted-firmware ]; then - ATF_DIR="$PWD"/arm-trusted-firmware - fi - - export WORKSPACE -} - - -function prepare_build -{ - get_build_arch - export ARCH=$BUILD_ARCH - - export ARCH - cd $EDK2_DIR - PACKAGES_PATH=$GLOBAL_PACKAGES_PATH . edksetup.sh --reconfig - if [ $? -ne 0 ]; then - echo "Sourcing edksetup.sh failed!" >&2 - exit 1 - fi - if [ $VERBOSE -eq 1 ]; then - echo "Building BaseTools" - fi - make -C BaseTools - RET=$? - cd - - if [ $RET -ne 0 ]; then - echo " !!! BaseTools failed to build !!! " >&2 - exit 1 - fi - - if [ "$IMPORT_OPENSSL" = "TRUE" ]; then - cd $EDK2_DIR - import_openssl - if [ $? -ne 0 ]; then - echo "Importing OpenSSL failed - aborting!" >&2 - echo " specify --no-openssl to attempt build anyway." >&2 - exit 1 - fi - cd $WORKSPACE - fi -} - - -function usage -{ - echo "usage:" - echo -n "uefi-build.sh [-b DEBUG | RELEASE] [ all " - for board in "${boards[@]}" ; do - echo -n "| $board " - done - echo "]" - printf "%8s\tbuild %s\n" "all" "all supported platforms" - for board in "${boards[@]}" ; do - PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`" - printf "%8s\tbuild %s\n" "$board" "${PLATFORM_NAME}" - done -} - -# -# Since we do a command line validation on whether specified platforms exist or -# not, do a first pass of command line to see if there is an explicit config -# file there to read valid platforms from. -# -commandline=( "$@" ) -i=0 -for arg; -do - if [ $arg == "-c" ]; then - FILE_ARG=${commandline[i + 1]} - if [ ! -f "$FILE_ARG" ]; then - echo "ERROR: configuration file '$FILE_ARG' not found" >&2 - exit 1 - fi - case "$FILE_ARG" in - /*) - PLATFORM_CONFIG="-c $FILE_ARG" - ;; - *) - PLATFORM_CONFIG="-c `readlink -f \"$FILE_ARG\"`" - ;; - esac - echo "Platform config file: '$FILE_ARG'" - fi - i=$(($i + 1)) -done - -export PLATFORM_CONFIG - -builds=() -boards=() -boardlist="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG shortlist`" -for board in $boardlist; do - boards=(${boards[@]} $board) -done - -NUM_TARGETS=0 - -while [ "$1" != "" ]; do - case $1 in - -1) # Disable build parallellism - NUM_THREADS=1 - ;; - -a | --arm-tf-dir) - shift - ATF_DIR="`readlink -f $1`" - ;; - -c) # Already parsed above - skip this + option - shift - ;; - -b | --build-target) - shift - echo "Adding Build target: $1" - TARGETS=(${TARGETS[@]} $1) - ;; - -D) # Pass through as -D option to 'build' - shift - echo "Adding Macro: -D $1" - EXTRA_OPTIONS=(${EXTRA_OPTIONS[@]} "-D" $1) - ;; - -e | --edk2-dir) - shift - export EDK2_DIR="`readlink -f $1`" - ;; - -h | --help) - usage - exit - ;; - --no-openssl) - IMPORT_OPENSSL=FALSE - ;; - -n | --non-osi-dir) - shift - NON_OSI_DIR="`readlink -f $1`" - ;; - -p | --platforms-dir) - shift - PLATFORMS_DIR="`readlink -f $1`" - ;; - -s | --tos-dir) - shift - export TOS_DIR="`readlink -f $1`" - ;; - -T) # Set specific toolchain tag, or clang/gcc for autoselection - shift - echo "Setting toolchain tag to '$1'" - TOOLCHAIN="$1" - ;; - -v) - VERBOSE=1 - ;; - all) # Add all targets in configuration file to list - builds=(${boards[@]}) - NUM_TARGETS=$(($NUM_TARGETS + 1)) - ;; - *) # Try to match target in configuration file, add to list - MATCH=0 - for board in "${boards[@]}" ; do - if [ "`echo $1 | cut -d: -f1`" == $board ]; then - MATCH=1 - builds=(${builds[@]} "$1") - break - fi - done - - if [ $MATCH -eq 0 ]; then - echo "unknown arg $1" - usage - exit 1 - fi - NUM_TARGETS=$(($NUM_TARGETS + 1)) - ;; - esac - shift -done - -if [ $NUM_TARGETS -le 0 ]; then - echo "No targets specified - exiting!" >&2 - exit 0 -fi - -export VERBOSE - -configure_paths - -prepare_build - -if [[ "${EXTRA_OPTIONS[@]}" != *"FIRMWARE_VER"* ]]; then - if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then - FIRMWARE_VER=`git rev-parse --short HEAD` - if ! git diff-index --quiet HEAD --; then - FIRMWARE_VER="${FIRMWARE_VER}-dirty" - fi - EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" FIRMWARE_VER=$FIRMWARE_VER ) - if [ $VERBOSE -eq 1 ]; then - echo "FIRMWARE_VER=$FIRMWARE_VER" - echo "EXTRA_OPTIONS=$EXTRA_OPTIONS" - fi - fi -fi - -for board in "${builds[@]}" ; do - do_build -done - -result_print diff --git a/uefi-tools/edk2-platforms.config b/uefi-tools/edk2-platforms.config deleted file mode 100644 index be743276..00000000 --- a/uefi-tools/edk2-platforms.config +++ /dev/null @@ -1,138 +0,0 @@ -# Platform build configurations for Linaro EDK2 builds -# ==================================================== -# The configuration file format is extremely simplistic: -# - Each platform has a short name. -# - A platform entry starts by the short name held in square brackets, '[]' -# - Within each entry, all options are described in a NAME=VALUE scheme, -# with the name being whatever comes before the first '=' on the line, -# and the value being everything that comes after it. -# -# Mandatory options: -# - LONGNAME A more descriptive name of the platform. -# - DSC Pointer to the EDK2 build description file. (The -# pandaboard is excused, all other ports must have this.) -# - ARCH String describing the architecture to build for. -# Currently supported are AARCH32 and AARCH64. -# - UEFI_BIN Name of executable image produced. -# - UEFI_IMAGE_DIR Build output directory name, relative to 'Build'. -# -# Options for Trusted OS -# Note that OP-TEE (https://github.com/OP-TEE/optee_os) is the only currently -# supported Trusted OS -# - BUILD_TOS Set to "yes" if the build should automatically build -# Trusted OS, mainly for ARM Trusted Firmware. -# If this is set, you must also set ATF_SPD! -# Else we will not know which specific Trusted OS to -# build. -# Set to "debug" to create a debug build. -# - TOS_PLATFORM Platform name for Trusted OS build, if -# different from ARM Trusted Firmware platform -# or UEFI platform name. -# - TOS_PLATFORM_FLAVOR If a core platform has multiple flavors, specify which -# flavor here. -# -# Options for ARM Trusted Firmware platforms -# - BUILD_ATF Set to "yes" if the build should automatically build -# ARM Trusted Firmware and a fip containing UEFI image. -# Set to "debug" to create a debug build. -# - ATF_PLATFORM Platform name for ARM Trusted Firmware build, if -# different from UEFI platform name. -# - SCP_BIN SCP image to pass to ARM Trusted Firmware. -# - TOS_BIN Trusted OS image to pass to ARM Trusted Firmware. -# The path is relative to -# $EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/. -# To actually build the Trusted OS, you must also set -# ATF_SPD. -# - ATF_SPD Name of Secure Payload Dispatcher -# To actually build the Trusted OS, you must also set -# TOS_BIN. -# -# Optional options: -# - BUILDFLAGS Any special flags you want to pass to the build command. -# - ATF_BUILDFLAGS Any special flags you want to pass to the ARM Trusted -# Firmware build command. -# - TOS_BUILDFLAGS Any special flags you want to pass to the Trusted OS -# build command. -# - EXTRA_FILES Any additional files to be copied to output dir. -# - PREBUILD_CMDS Any commands you want to execute before the build step. -# - POSTBUILD_CMDS Any commands you want to execute after the build step. -# - PACKAGES_PATH Additional directories to search for packages under. -# - INF Point to a .inf (in addition to a .dsc) in order to -# build a single component (standalone driver/app). -# - -[juno] -LONGNAME=aarch64 Juno -DSC=Platform/ARM/JunoPkg/ArmJuno.dsc -BUILDFLAGS= -ARCH=AARCH64 -BUILD_ATF=yes -SCP_BIN=Platform/ARM/Juno/bl30.bin -UEFI_BIN=BL33_AP_UEFI.fd -UEFI_IMAGE_DIR=ArmJuno - -# ARM FVP BASE AEMv8-A model -[fvp] -LONGNAME=aarch64 FVP RTSM -DSC=Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -BUILDFLAGS=-D EDK2_ENABLE_SMSC_91X=1 -D EDK2_ENABLE_PL111=1 -ARCH=AARCH64 -BUILD_ATF=yes -UEFI_BIN=FVP_AARCH64_EFI.fd -UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64 - -[tc2] -LONGNAME=Versatile Express TC2 -BUILDFLAGS=-D ARM_BIGLITTLE_TC2=1 -DSC=Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc -ARCH=ARM - -[overdrive] -LONGNAME=AMD Overdrive -DSC=Platform/AMD/OverdriveBoard/OverdriveBoard.dsc -ARCH=AARCH64 - -[overdrive1000] -LONGNAME=SoftIron Overdrive 1000 -DSC=Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc -ARCH=AARCH64 - -[cello] -LONGNAME=LeMaker Cello -DSC=Platform/LeMaker/CelloBoard/CelloBoard.dsc -ARCH=AARCH64 - -[hikey] -LONGNAME=HiKey -DSC=Platform/Hisilicon/HiKey/HiKey.dsc -ARCH=AARCH64 - -[d02] -LONGNAME=Hisilicon D02 -DSC=Platform/Hisilicon/D02/Pv660D02.dsc -ARCH=AARCH64 - -[d03] -LONGNAME=Hisilicon D03 -DSC=Platform/Hisilicon/D03/D03.dsc -ARCH=AARCH64 - -[d05] -LONGNAME=HiSilicon D05 -DSC=Platform/Hisilicon/D05/D05.dsc -ARCH=AARCH64 - -[armada70x0] -LONGNAME=Marvell Armada 70x0 -DSC=Platform/Marvell/Armada/Armada70x0.dsc -ARCH=AARCH64 - -[chaoskey] -LONGNAME=Altus Metrum ChaosKey RNG -DSC=Silicon/Openmoko/Openmoko.dsc -ARCH=AARCH64 - -[beagle] -LONGNAME=Beagleboard (original) -DSC=BeagleBoardPkg/BeagleBoardPkg.dsc -ARCH=ARM diff --git a/uefi-tools/edk2-to-git-am.sh b/uefi-tools/edk2-to-git-am.sh deleted file mode 100755 index d3f8a27e..00000000 --- a/uefi-tools/edk2-to-git-am.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# Convert one or more git patches that have had it's CR:s stripped out by SMTP -# into something th - -if [ $# -lt 1 ]; then - echo "usage: `basename $0` <filename>" >&2 - exit 1 -fi - -convert_file() -{ - sed -i "s/$/\r/g" "$1" - sed -i "s:^\(---\|+++ \)\(.*\)\r$:\1\2:g" "$1" -} - -while [ $# -gt 0 ]; do - convert_file "$1" - shift -done diff --git a/uefi-tools/handy-snippets.sh b/uefi-tools/handy-snippets.sh deleted file mode 100644 index 834ca741..00000000 --- a/uefi-tools/handy-snippets.sh +++ /dev/null @@ -1,8 +0,0 @@ -# -# First step in looking for duplicate file GUIDs -# -# find . -name "*.inf" | \ -# xargs grep -H FILE_GUID | \ -# sed 's/^\(.*\):[ \t]*FILE_GUID[ \t]*=[ \t]*\([a-f.A-F.0-9.-]*\).*\r$/\2 \1/' | \ -# sort -# diff --git a/uefi-tools/opteed-build.sh b/uefi-tools/opteed-build.sh deleted file mode 100755 index 702860e6..00000000 --- a/uefi-tools/opteed-build.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/bash -# -# Builds OP-TEE Trusted OS. -# Not intended to be called directly, invoked from tos-build.sh. -# -# Board configuration is extracted from -# parse-platforms.py and platforms.config. -# - -. "$TOOLS_DIR"/common-functions - -export CFG_TEE_CORE_LOG_LEVEL=2 # 0=none 1=err 2=info 3=debug 4=flow - -function usage -{ - echo "usage:" - echo "opteed-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>" - echo -} - -function build_platform -{ - unset CFG_ARM64_core PLATFORM PLATFORM_FLAVOR DEBUG - TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform`" - if [ X"$TOS_PLATFORM" = X"" ]; then - TOS_PLATFORM="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_platform`" - if [ X"$TOS_PLATFORM" = X"" ]; then - TOS_PLATFORM=$1 - fi - fi - TOS_PLATFORM_FLAVOR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_platform_flavor`" - - # - # Read platform configuration - # - PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o arch`" - PLATFORM_IMAGE_DIR="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o uefi_image_dir`" - PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_buildflags`" - - if [ $VERBOSE -eq 1 ]; then - echo "PLATFORM_ARCH=$PLATFORM_ARCH" - echo "PLATFORM_IMAGE_DIR=$PLATFORM_IMAGE_DIR" - echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS" - fi - - # - # Set up cross compilation variables (if applicable) - # - # OP-TEE requires both 64- and 32-bit compilers for a 64-bit build - # For details, visit - # https://github.com/OP-TEE/optee_os/blob/master/documentation/build_system.md#cross_compile-cross-compiler-selection - # - set_cross_compile - if [ "$PLATFORM_ARCH" = "AARCH64" ]; then - export CFG_ARM64_core=y - export CROSS_COMPILE_core="$TEMP_CROSS_COMPILE" - export CROSS_COMPILE_ta_arm64="$TEMP_CROSS_COMPILE" - PLATFORM_ARCH="ARM" - set_cross_compile - PLATFORM_ARCH="AARCH64" - echo "CFG_ARM64_core=$CFG_ARM64_core" - echo "CROSS_COMPILE_ta_arm64=$CROSS_COMPILE_ta_arm64" - else - export CFG_ARM64_core=n - fi - export CROSS_COMPILE="$TEMP_CROSS_COMPILE" - echo "CROSS_COMPILE=$CROSS_COMPILE" - echo "CROSS_COMPILE_core=$CROSS_COMPILE_core" - - # - # Set up build variables - # - BUILD_TOS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" - case "$BUILD_TOS" in - debug*) - export DEBUG=1 - echo "PROFILE=DEBUG" - ;; - *) - export DEBUG=0 - echo "PROFILE=RELEASE" - ;; - esac - - export PLATFORM=$TOS_PLATFORM - export PLATFORM_FLAVOR=$TOS_PLATFORM_FLAVOR - echo "PLATFORM=$PLATFORM" - echo "PLATFORM_FLAVOR=$PLATFORM_FLAVOR" - echo "CFG_TEE_CORE_LOG_LEVEL=$CFG_TEE_CORE_LOG_LEVEL" - - # - # Build OP-TEE - # - if [ $VERBOSE -eq 1 ]; then - echo "Calling OP-TEE build:" - fi - make -j$NUM_THREADS ${PLATFORM_BUILDFLAGS} - if [ $? -eq 0 ]; then - # - # Copy resulting images to UEFI image dir - # - TOS_BIN="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o tos_bin`" - if [ $VERBOSE -eq 1 ]; then - echo "Copying '$TOS_BIN' to '$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/'" - fi - cp -a out/arm-plat-"$TOS_PLATFORM"/core/"$TOS_BIN" "$EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/" - else - return 1 - fi -} - -# Check to see if we are in a trusted OS directory -# refuse to continue if we aren't -if [ ! -f documentation/optee_design.md ] -then - echo "ERROR: we aren't in the optee_os directory." - usage - exit 1 -fi - -build= - -if [ $# = 0 ] -then - usage - exit 1 -else - while [ "$1" != "" ]; do - case $1 in - "-e" ) - shift - EDK2_DIR="$1" - ;; - "/h" | "/?" | "-?" | "-h" | "--help" ) - usage - exit - ;; - "-t" ) - shift - BUILD_PROFILE="$1" - ;; - * ) - build="$1" - ;; - esac - shift - done -fi - -if [ X"$build" = X"" ]; then - echo "No platform specified!" >&2 - echo - usage - exit 1 -fi - -build_platform $build -exit $? diff --git a/uefi-tools/parse-platforms.py b/uefi-tools/parse-platforms.py deleted file mode 100755 index af440387..00000000 --- a/uefi-tools/parse-platforms.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/python - -import sys, os, argparse, ConfigParser - -default_filename='platforms.config' - -def list_platforms(): - for p in platforms: print p - -def shortlist_platforms(): - for p in platforms: print p, - -def get_images(): - if args.platform: - try: - value = config.get(args.platform, "EXTRA_FILES") - print value, - except: - pass - try: - value = config.get(args.platform, "BUILD_ATF") - if value == "yes": - print "bl1.bin fip.bin" - return True - except: - try: - value = config.get(args.platform, "UEFI_BIN") - print value - return True - except: - print "No images found!" - else: - print "No platform specified!" - - return False - -def get_option(): - if args.platform: - if args.option: - try: - value = config.get(args.platform, args.option) - if value: - print value - return True - except: - return True # Option not found, return True, and no output - else: - print "No option specified!" - else: - print "No platform specified!" - return False - -parser = argparse.ArgumentParser(description='Parses platform configuration for Linaro UEFI build scripts.') -parser.add_argument('-c', '--config-file', help='Specify a non-default platform config file.', required=False) -parser.add_argument('-p', '--platform', help='Read configuration for PLATFORM only.', required=False) -parser.add_argument('command', action="store", help='Action to perform') -parser.add_argument('-o', '--option', help='Option to retreive') - -args = parser.parse_args() -if args.config_file: - config_filename = args.config_file -else: - config_filename = os.path.dirname(os.path.realpath(sys.argv[0])) + '/' + default_filename - -config = ConfigParser.ConfigParser() -config.read(config_filename) - -platforms = config.sections() - -commands = {"shortlist": shortlist_platforms, - "list": list_platforms, - "images": get_images, - "get": get_option} - -try: - retval = commands[args.command]() -except: - print ("Unrecognized command '%s'" % args.command) - -if retval != True: - sys.exit(1) diff --git a/uefi-tools/platforms.config b/uefi-tools/platforms.config deleted file mode 100644 index deb02f40..00000000 --- a/uefi-tools/platforms.config +++ /dev/null @@ -1,306 +0,0 @@ -# Platform build configurations for Linaro EDK2 builds -# ==================================================== -# The configuration file format is extremely simplistic: -# - Each platform has a short name. -# - A platform entry starts by the short name held in square brackets, '[]' -# - Within each entry, all options are described in a NAME=VALUE scheme, -# with the name being whatever comes before the first '=' on the line, -# and the value being everything that comes after it. -# -# Mandatory options: -# - LONGNAME A more descriptive name of the platform. -# - DSC Pointer to the EDK2 build description file. (The -# pandaboard is excused, all other ports must have this.) -# - ARCH String describing the architecture to build for. -# Currently supported are AARCH32 and AARCH64. -# - UEFI_BIN Name of executable image produced. -# - UEFI_IMAGE_DIR Build output directory name, relative to 'Build'. -# -# Options for Trusted OS -# Note that OP-TEE (https://github.com/OP-TEE/optee_os) is the only currently -# supported Trusted OS -# - BUILD_TOS Set to "yes" if the build should automatically build -# Trusted OS, mainly for ARM Trusted Firmware. -# If this is set, you must also set ATF_SPD! -# Else we will not know which specific Trusted OS to -# build. -# Set to "debug" to create a debug build. -# - TOS_PLATFORM Platform name for Trusted OS build, if -# different from ARM Trusted Firmware platform -# or UEFI platform name. -# - TOS_PLATFORM_FLAVOR If a core platform has multiple flavors, specify which -# flavor here. -# -# Options for ARM Trusted Firmware platforms -# - BUILD_ATF Set to "yes" if the build should automatically build -# ARM Trusted Firmware and a fip containing UEFI image. -# Set to "debug" to create a debug build. -# - ATF_PLATFORM Platform name for ARM Trusted Firmware build, if -# different from UEFI platform name. -# - SCP_BIN SCP image to pass to ARM Trusted Firmware. -# - TOS_BIN Trusted OS image to pass to ARM Trusted Firmware. -# The path is relative to -# $EDK2_DIR/Build/$PLATFORM_IMAGE_DIR/$BUILD_PROFILE/FV/. -# To actually build the Trusted OS, you must also set -# ATF_SPD. -# - ATF_SPD Name of Secure Payload Dispatcher -# To actually build the Trusted OS, you must also set -# TOS_BIN. -# - SPM_BIN Prebuilt Secure Partition image to pass to ARM Trusted Firmware. -# The path is relative to -# $EDK2_DIR/Build/StandaloneSmmPkg/$BUILD_PROFILE/FV/. -# -# Optional options: -# - BUILDFLAGS Any special flags you want to pass to the build command. -# - ATF_BUILDFLAGS Any special flags you want to pass to the ARM Trusted -# Firmware build command. -# - TOS_BUILDFLAGS Any special flags you want to pass to the Trusted OS -# build command. -# - EXTRA_FILES Any additional files to be copied to output dir. -# - PREBUILD_CMDS Any commands you want to execute before the build step. -# - POSTBUILD_CMDS Any commands you want to execute after the build step. -# - PACKAGES_PATH Additional directories to search for packages under. -# - INF Point to a .inf (in addition to a .dsc) in order to -# build a single component (standalone driver/app). -# - -[juno] -LONGNAME=aarch64 Juno -DSC=OpenPlatformPkg/Platforms/ARM/Juno/ArmJuno.dsc -BUILDFLAGS= -ARCH=AARCH64 -BUILD_ATF=yes -UEFI_BIN=BL33_AP_UEFI.fd -UEFI_IMAGE_DIR=ArmJuno -SCP_BIN=OpenPlatformPkg/Platforms/ARM/Juno/Binary/bl30.bin -EXTRA_FILES=../../../../OpenPlatformPkg/Platforms/ARM/Juno/Binary/bl0.bin ../../../../OpenPlatformPkg/Platforms/ARM/Juno/Binary/Copying.txt - -# ARM FVP BASE AEMv8-A model -[fvp_full] -LONGNAME=aarch64 FVP RTSM with full perhiperhal set -DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc -BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-Full -D EDK2_ENABLE_SMSC_91X=1 -D EDK2_ENABLE_PL111=1 -ARCH=AARCH64 -UEFI_BIN=FVP_AARCH64_EFI.fd -UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-Full - -[fvp] -LONGNAME=aarch64 FVP RTSM -DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc -BUILDFLAGS=-D EDK2_ENABLE_SMSC_91X=1 -ARCH=AARCH64 -BUILD_ATF=yes -UEFI_BIN=FVP_AARCH64_EFI.fd -UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64 - -# ARM FVP BASE AEMv8-A model -[fvp_mm_standalone] -LONGNAME=FVP Base for MM Standalone image in secure world -DSC=StandaloneSmmPkg/StandaloneSmmPkg.dsc -ARCH=AARCH64 -UEFI_BIN=FVP_AARCH64_EFI_MM_STANDALONE.fd -UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Standalone - -[fvp_mm_normal] -LONGNAME=FVP Base for UEFI image with MM support in normal world -DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc -BUILDFLAGS=-D EDK2_OUT_DIR=Build/ArmVExpress-FVP-AArch64-MM-Normal -D ARM_STANDALONE_MM_ENABLE=TRUE -ARCH=AARCH64 -BUILD_ATF=debug -UEFI_BIN=FVP_AARCH64_EFI.fd -UEFI_IMAGE_DIR=ArmVExpress-FVP-AArch64-MM-Normal -ATF_PLATFORM=fvp -SPM_BIN=STANDALONESMM.fd -ATF_BUILDFLAGS=ARM_BL31_IN_DRAM=1 - -[tc2] -LONGNAME=Versatile Express TC2 -BUILDFLAGS=-D ARM_BIGLITTLE_TC2=1 -DSC=OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc -ARCH=ARM -UEFI_BIN=ARM_VEXPRESS_CTA15A7_EFI.fd -UEFI_IMAGE_DIR=ArmVExpress-CTA15-A7 - -[beagle] -LONGNAME=BeagleBoard -BUILDFLAGS= -DSC=BeagleBoardPkg/BeagleBoardPkg.dsc -ARCH=ARM - -[d01] -LONGNAME=HiSilicon D01 Cortex-A15 16-cores -BUILDFLAGS=-D EDK2_ARMVE_STANDALONE=1 -DSC=HisiPkg/D01BoardPkg/D01BoardPkg.dsc -ARCH=ARM -UEFI_BIN=D01.fd -UEFI_IMAGE_DIR=D01 - -[d01-intelbds] -LONGNAME=HiSilicon D01 Cortex-A15 16-cores Intel Bds -BUILDFLAGS=-D EDK2_ARMVE_STANDALONE=1 -D INTEL_BDS -D NO_LINUX_LOADER -D EDK2_OUT_DIR=Build/D01-IntelBds -DSC=HisiPkg/D01BoardPkg/D01BoardPkg.dsc -ARCH=ARM -UEFI_BIN=D01.fd -UEFI_IMAGE_DIR=D01 - -[qemu] -LONGNAME=QEMU ARM Emulator -BUILDFLAGS=-D INTEL_BDS -DSC=ArmVirtPkg/ArmVirtQemu.dsc -ARCH=ARM -UEFI_BIN=QEMU_EFI.fd -UEFI_IMAGE_DIR=ArmVirtQemu-ARM - -[qemu64] -LONGNAME=QEMU AArch64 Emulator -BUILDFLAGS=-D INTEL_BDS -DSC=ArmVirtPkg/ArmVirtQemu.dsc -ARCH=AARCH64 -UEFI_BIN=QEMU_EFI.fd -UEFI_IMAGE_DIR=ArmVirtQemu-AARCH64 - -[mustang] -LONGNAME=APM XGene Mustang -BUILDFLAGS= -DSC=ArmPlatformPkg/APMXGenePkg/APMXGene-Mustang.dsc -ARCH=AARCH64 -UEFI_BIN=APMXGENE-MUSTANG.fd SEC_APMXGENE-MUSTANG.fd -UEFI_IMAGE_DIR=APMXGene-Mustang - -[overdrive] -LONGNAME=AMD Overdrive -BUILDFLAGS=-D INTEL_BDS -DSC=OpenPlatformPkg/Platforms/AMD/Styx/OverdriveBoard/OverdriveBoard.dsc -ARCH=AARCH64 -PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary -UEFI_BIN=STYX_ROM.fd -UEFI_IMAGE_DIR=Overdrive - -[overdrive1000] -LONGNAME=SoftIron Overdrive 1000 -BUILDFLAGS=-D INTEL_BDS -DSC=OpenPlatformPkg/Platforms/AMD/Styx/Overdrive1000Board/Overdrive1000Board.dsc -ARCH=AARCH64 -PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary -UEFI_BIN=OVERDRIVE1000_ROM.fd -UEFI_IMAGE_DIR=Overdrive1000Board - -[cello] -LONGNAME=LeMaker Cello -BUILDFLAGS=-D INTEL_BDS -DSC=OpenPlatformPkg/Platforms/AMD/Styx/CelloBoard/CelloBoard.dsc -ARCH=AARCH64 -PACKAGES_PATH=OpenPlatformPkg/Platforms/AMD/Styx/Binary -UEFI_BIN=STYX_ROM.fd -UEFI_IMAGE_DIR=Cello - -# NOTE: If using upstream ATF, i.e. -# https://github.com/ARM-software/arm-trusted-firmware -# please set TOS_BIN=tee-pager.bin -[hikey] -LONGNAME=CircuitCo HiKey -DSC=OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKey.dsc -ARCH=AARCH64 -UEFI_BIN=BL33_AP_UEFI.fd -UEFI_IMAGE_DIR=HiKey -BUILD_ATF=yes -ATF_SPD=opteed -TOS_BIN=tee.bin -TOS_PLATFORM_FLAVOR=hikey -BUILD_TOS=yes -SCP_BIN=OpenPlatformPkg/Platforms/Hisilicon/HiKey/Binary/mcuimage.bin -# Uncomment this to use UART0 as the EDK2 console -#BUILDFLAGS=-DSERIAL_BASE=0xF8015000 -# Uncomment this to use UART0 as the ARM Trusted Firmware console -#ATF_BUILDFLAGS=CONSOLE_BASE=PL011_UART0_BASE CRASH_CONSOLE_BASE=PL011_UART0_BASE -# Uncomment this to use UART0 as the OP-TEE Trusted OS console -#TOS_BUILDFLAGS=CFG_CONSOLE_UART=0 - -[hikey960] -LONGNAME=Hikey960 -DSC=OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960.dsc -ARCH=AARCH64 -UEFI_BIN=BL33_AP_UEFI.fd -UEFI_IMAGE_DIR=HiKey960 -BUILD_ATF=yes -ATF_SPD=opteed -TOS_BIN=tee-pager.bin -TOS_PLATFORM=hikey -TOS_PLATFORM_FLAVOR=hikey960 -BUILD_TOS=yes -SCP_BIN=OpenPlatformPkg/Platforms/Hisilicon/HiKey960/Binary/lpm3.img -# Uncomment this to use UART5 as the EDK2 console for v1 hardware -#BUILDFLAGS=-DSERIAL_BASE=0xFDF05000 - -[xen64] -LONGNAME=AArch64 Xen guest -BUILDFLAGS= -DSC=ArmVirtPkg/ArmVirtXen.dsc -ARCH=AARCH64 -UEFI_BIN=XEN_EFI.fd -UEFI_IMAGE_DIR=ArmVirtXen-AARCH64 - -[aarch64-shell] -LONGNAME=AArch64 EFI Shell -BUILDFLAGS=-D INCLUDE_TFTP_COMMAND -DSC=ShellPkg/ShellPkg.dsc -ARCH=AARCH64 - -[aarch64-shell-minimal] -LONGNAME=AArch64 EFI Shell (Minimal) -BUILDFLAGS=-D NO_SHELL_PROFILES -DSC=ShellPkg/ShellPkg.dsc -ARCH=AARCH64 - -[arm-shell] -LONGNAME=ARM EFI Shell -BUILDFLAGS=-D INCLUDE_TFTP_COMMAND -DSC=ShellPkg/ShellPkg.dsc -ARCH=ARM - -[arm-shell-minimal] -LONGNAME=ARM EFI Shell (Minimal) -BUILDFLAGS=-D NO_SHELL_PROFILES -DSC=ShellPkg/ShellPkg.dsc -ARCH=ARM - -[d02] -LONGNAME=Hisilicon D02 -DSC=OpenPlatformPkg/Platforms/Hisilicon/D02/Pv660D02.dsc -ARCH=AARCH64 -UEFI_BIN=PV660D02.fd -UEFI_IMAGE_DIR=Pv660D02 - -[d03] -LONGNAME=Hisilicon D03 -DSC=OpenPlatformPkg/Platforms/Hisilicon/D03/D03.dsc -ARCH=AARCH64 -UEFI_BIN=D03.fd -UEFI_IMAGE_DIR=D03 - -[d05] -LONGNAME=HiSilicon D05 -DSC=OpenPlatformPkg/Platforms/Hisilicon/D05/D05.dsc -ARCH=AARCH64 -UEFI_BIN=D05.fd -UEFI_IMAGE_DIR=D05 - -[armada70x0] -LONGNAME=Marvell Armada 70x0 -DSC=OpenPlatformPkg/Platforms/Marvell/Armada/Armada70x0.dsc -ARCH=AARCH64 - -[ovmfx64] -LONGNAME=OVMF Qemu X64 -DSC=OvmfPkg/OvmfPkgX64.dsc -ARCH=X64 - -[hello] -LONGNAME=EDK2 Hello World Example -DSC=MdeModulePkg/MdeModulePkg.dsc -INF=MdeModulePkg/Application/HelloWorld/HelloWorld.inf - -[chaoskey] -LONGNAME=Altus Metrum ChaosKey Driver -DSC=OptionRomPkg/OptionRomPkg.dsc -INF=OpenPlatformPkg/Drivers/Usb/Misc/ChaosKeyDxe/ChaosKeyDxe.inf diff --git a/uefi-tools/tos-build.sh b/uefi-tools/tos-build.sh deleted file mode 100755 index a3bf4211..00000000 --- a/uefi-tools/tos-build.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -# -# Builds Trusted OS, mainly for ARM Trusted Firmware. -# Calls $ATF_SPD-build.sh for the actual build of a specific Trusted OS. -# Not intended to be called directly, invoked from uefi-build.sh. -# -# Board configuration is extracted from -# parse-platforms.py and platforms.config. -# - -. "$TOOLS_DIR"/common-functions - -function usage -{ - echo "usage:" - echo "tos-build.sh -e <EDK2 source directory> -t <UEFI build profile/toolchain> <platform>" - echo -} - -function build_platform -{ - if [ X"$EDK2_DIR" = X"" ];then - echo "EDK2_DIR not set!" >&2 - return 1 - fi - - if [ X"`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o build_tos`" = X"" ]; then - echo "Platform '$1' is not configured to build Trusted OS." - return 0 - fi - - # - # Build Trusted OS - # - ATF_SPD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $1 get -o atf_spd`" - if [ -f $TOOLS_DIR/$ATF_SPD-build.sh ]; then - echo "Building $ATF_SPD Trusted OS" - if [ $VERBOSE -eq 1 ]; then - echo "$TOOLS_DIR/$ATF_SPD-build.sh -e "$EDK2_DIR" -t "$BUILD_PROFILE" $build" - fi - $TOOLS_DIR/$ATF_SPD-build.sh -e "$EDK2_DIR" -t "$BUILD_PROFILE" $build - return $? - else - echo "ERROR: missing Trusted OS build script." - echo " Or build script not named $ATF_SPD-build.sh" - return 1 - fi -} - -build= - -if [ $# = 0 ] -then - usage - exit 1 -else - while [ "$1" != "" ]; do - case $1 in - "-e" ) - shift - EDK2_DIR="$1" - ;; - "/h" | "/?" | "-?" | "-h" | "--help" ) - usage - exit - ;; - "-t" ) - shift - BUILD_PROFILE="$1" - ;; - * ) - build="$1" - ;; - esac - shift - done -fi - -if [ X"$build" = X"" ]; then - echo "No platform specified!" >&2 - echo - usage - exit 1 -fi - -build_platform $build -exit $? diff --git a/uefi-tools/uefi-build.sh b/uefi-tools/uefi-build.sh deleted file mode 100755 index 7fec3d08..00000000 --- a/uefi-tools/uefi-build.sh +++ /dev/null @@ -1,398 +0,0 @@ -#!/bin/bash - -# -# Board Configuration Section -# =========================== -# -# Board configuration moved to parse-platforms.py and platforms.config. -# -# No need to edit below unless you are changing script functionality. -# - -unset WORKSPACE EDK_TOOLS_DIR MAKEFLAGS - -TOOLS_DIR="`dirname $0`" -export TOOLS_DIR -. "$TOOLS_DIR"/common-functions -PLATFORM_CONFIG="" -VERBOSE=0 -ATF_DIR= -TOS_DIR= -TOOLCHAIN= -OPENSSL_CONFIGURED=FALSE - -# Number of threads to use for build -export NUM_THREADS=$((`getconf _NPROCESSORS_ONLN` + 1)) - -function do_build -{ - PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`" - PLATFORM_PREBUILD_CMDS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o prebuild_cmds`" - PLATFORM_BUILDFLAGS="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildflags`" - PLATFORM_BUILDFLAGS="$PLATFORM_BUILDFLAGS ${EXTRA_OPTIONS[@]}" - PLATFORM_BUILDCMD="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o buildcmd`" - PLATFORM_DSC="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o dsc`" - PLATFORM_PACKAGES_PATH="$PWD" - COMPONENT_INF="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o inf`" - - PLATFORM_ARCH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o arch`" - if [ -n "$PLATFORM_ARCH" ]; then - if [ -n "$DEFAULT_PLATFORM_ARCH" -a "$DEFAULT_PLATFORM_ARCH" != "$PLATFORM_ARCH" ]; then - echo "Command line specified architecture '$DEFAULT_PLATFORM_ARCH'" >&2 - echo "differs from config file specified '$PLATFORM_ARCH'" >&2 - return 1 - fi - else - if [ ! -n "$DEFAULT_PLATFORM_ARCH" ]; then - echo "Unknown target architecture - aborting!" >&2 - return 1 - fi - PLATFORM_ARCH="$DEFAULT_PLATFORM_ARCH" - fi - TEMP_PACKAGES_PATH="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o packages_path`" - if [ -n "$TEMP_PACKAGES_PATH" ]; then - IFS=: - for path in "$TEMP_PACKAGES_PATH"; do - case "$path" in - /*) - PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$path" - ;; - *) - PLATFORM_PACKAGES_PATH="$PLATFORM_PACKAGES_PATH:$PWD/$path" - ;; - esac - done - unset IFS - fi - if [ $VERBOSE -eq 1 ]; then - echo "Setting build parallellism to $NUM_THREADS processes\n" - echo "PLATFORM_NAME=$PLATFORM_NAME" - echo "PLATFORM_PREBUILD_CMDS=$PLATFORM_PREBUILD_CMDS" - echo "PLATFORM_BUILDFLAGS=$PLATFORM_BUILDFLAGS" - echo "PLATFORM_BUILDCMD=$PLATFORM_BUILDCMD" - echo "PLATFORM_DSC=$PLATFORM_DSC" - echo "PLATFORM_ARCH=$PLATFORM_ARCH" - echo "PLATFORM_PACKAGES_PATH=$PLATFORM_PACKAGES_PATH" - fi - - if [[ "${PLATFORM_BUILDFLAGS}" =~ "SECURE_BOOT_ENABLE=TRUE" ]]; then - import_openssl - fi - - if [ -n "$CROSS_COMPILE_64" -a "$PLATFORM_ARCH" == "AARCH64" ]; then - TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" - elif [ -n "$CROSS_COMPILE_32" -a "$PLATFORM_ARCH" == "ARM" ]; then - TEMP_CROSS_COMPILE="$CROSS_COMPILE_32" - else - set_cross_compile - fi - - CROSS_COMPILE="$TEMP_CROSS_COMPILE" - - echo "Building $PLATFORM_NAME - $PLATFORM_ARCH" - echo "CROSS_COMPILE=\"$TEMP_CROSS_COMPILE\"" - echo "$board"_BUILDFLAGS="'$PLATFORM_BUILDFLAGS'" - - if [ "$TARGETS" == "" ]; then - TARGETS=( RELEASE ) - fi - - case $TOOLCHAIN in - "gcc") - TOOLCHAIN=`get_gcc_version "$CROSS_COMPILE"gcc` - if [ $? -ne 0 ]; then - echo "${CROSS_COMPILE}gcc not found!" >&2 - return 1 - fi - ;; - "clang") - TOOLCHAIN=`get_clang_version clang` - if [ $? -ne 0 ]; then - return 1 - fi - ;; - esac - export TOOLCHAIN - echo "TOOLCHAIN is ${TOOLCHAIN}" - - export ${TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE - echo "Toolchain prefix: ${TOOLCHAIN}_${PLATFORM_ARCH}_PREFIX=$CROSS_COMPILE" - - export PACKAGES_PATH="$PLATFORM_PACKAGES_PATH" - for target in "${TARGETS[@]}" ; do - if [ X"$PLATFORM_PREBUILD_CMDS" != X"" ]; then - echo "Run pre build commands" - eval ${PLATFORM_PREBUILD_CMDS} - fi - - if [ -n "$COMPONENT_INF" ]; then - # Build a standalone component - build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${TOOLCHAIN} -p "$PLATFORM_DSC" \ - -m "$COMPONENT_INF" -b "$target" ${PLATFORM_BUILDFLAGS} - else - # Build a platform - build -n $NUM_THREADS -a "$PLATFORM_ARCH" -t ${TOOLCHAIN} -p "$PLATFORM_DSC" \ - -b "$target" ${PLATFORM_BUILDFLAGS} - fi - - RESULT=$? - if [ $RESULT -eq 0 ]; then - if [ X"$TOS_DIR" != X"" ]; then - pushd $TOS_DIR >/dev/null - if [ $VERBOSE -eq 1 ]; then - echo "$TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board" - fi - $TOOLS_DIR/tos-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board - RESULT=$? - popd >/dev/null - fi - fi - if [ $RESULT -eq 0 ]; then - if [ X"$ATF_DIR" != X"" ]; then - pushd $ATF_DIR >/dev/null - if [ $VERBOSE -eq 1 ]; then - echo "$TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board" - fi - $TOOLS_DIR/atf-build.sh -e "$EDK2_DIR" -t "$target"_${TOOLCHAIN} $board - RESULT=$? - popd >/dev/null - fi - fi - result_log $RESULT "$PLATFORM_NAME $target" - done - unset PACKAGES_PATH -} - - -function clearcache -{ - CONF_FILES="build_rule target tools_def" - if [ -z "$EDK_TOOLS_PATH" ] - then - TEMPLATE_PATH=./BaseTools/Conf/ - else - TEMPLATE_PATH="$EDK_TOOLS_PATH/Conf/" - fi - - for File in $CONF_FILES - do - TEMPLATE_FILE="$TEMPLATE_PATH/$File.template" - CACHE_FILE="Conf/$File.txt" - if [ -e "$CACHE_FILE" -a "$TEMPLATE_FILE" -nt "$CACHE_FILE" ] - then - echo "Removing outdated '$CACHE_FILE'." - rm "$CACHE_FILE" - fi - done - - unset TEMPLATE_PATH TEMPLATE_FILE CACHE_FILE -} - - -function uefishell -{ - BUILD_ARCH=`uname -m` - case $BUILD_ARCH in - arm*) - ARCH=ARM - ;; - aarch64) - ARCH=AARCH64 - ;; - *) - unset ARCH - ;; - esac - export ARCH - export EDK_TOOLS_PATH=`pwd`/BaseTools - clearcache - . edksetup.sh BaseTools - if [ $VERBOSE -eq 1 ]; then - echo "Building BaseTools" - fi - make -C $EDK_TOOLS_PATH - if [ $? -ne 0 ]; then - echo " !!! UEFI BaseTools failed to build !!! " >&2 - exit 1 - fi -} - - -function usage -{ - echo "usage:" - echo -n "uefi-build.sh [-b DEBUG | RELEASE] [ all " - for board in "${boards[@]}" ; do - echo -n "| $board " - done - echo "]" - printf "%8s\tbuild %s\n" "all" "all supported platforms" - for board in "${boards[@]}" ; do - PLATFORM_NAME="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG -p $board get -o longname`" - printf "%8s\tbuild %s\n" "$board" "${PLATFORM_NAME}" - done -} - -# -# Since we do a command line validation on whether specified platforms exist or -# not, do a first pass of command line to see if there is an explicit config -# file there to read valid platforms from. -# -commandline=( "$@" ) -i=0 -for arg; -do - if [ $arg == "-c" ]; then - FILE_ARG=${commandline[i + 1]} - if [ ! -f "$FILE_ARG" ]; then - echo "ERROR: configuration file '$FILE_ARG' not found" >&2 - exit 1 - fi - case "$FILE_ARG" in - /*) - PLATFORM_CONFIG="-c $FILE_ARG" - ;; - *) - PLATFORM_CONFIG="-c `readlink -f \"$FILE_ARG\"`" - ;; - esac - echo "Platform config file: '$FILE_ARG'" - export PLATFORM_CONFIG - fi - i=$(($i + 1)) -done - -builds=() -boards=() -boardlist="`$TOOLS_DIR/parse-platforms.py $PLATFORM_CONFIG shortlist`" -for board in $boardlist; do - boards=(${boards[@]} $board) -done - -NUM_TARGETS=0 - -while [ "$1" != "" ]; do - case $1 in - all ) - builds=(${boards[@]}) - NUM_TARGETS=$(($NUM_TARGETS + 1)) - ;; - "/h" | "/?" | "-?" | "-h" | "--help" ) - usage - exit - ;; - "-v" ) - VERBOSE=1 - ;; - "-a" ) - shift - ATF_DIR="$1" - ;; - "-A" ) - shift - DEFAULT_PLATFORM_ARCH="$1" - ;; - "-c" ) - # Already parsed above - skip this + option - shift - ;; - "-s" ) - shift - export TOS_DIR="$1" - ;; - "-b" | "--build" ) - shift - echo "Adding Build profile: $1" - TARGETS=( ${TARGETS[@]} $1 ) - ;; - "-D" ) - shift - echo "Adding option: -D $1" - EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" $1 ) - ;; - "-T" ) - shift - echo "Setting toolchain to '$1'" - TOOLCHAIN="$1" - ;; - "-1" ) - NUM_THREADS=1 - ;; - * ) - MATCH=0 - for board in "${boards[@]}" ; do - if [ "$1" == $board ]; then - MATCH=1 - builds=(${builds[@]} "$board") - break - fi - done - - if [ $MATCH -eq 0 ]; then - echo "unknown arg $1" - usage - exit 1 - fi - NUM_TARGETS=$(($NUM_TARGETS + 1)) - ;; - esac - shift -done - -# If there were no args, use a menu to select a single board / all boards to build -if [ $NUM_TARGETS -eq 0 ] -then - read -p "$( - f=0 - for board in "${boards[@]}" ; do - echo "$((++f)): $board" - done - echo $((++f)): all - - echo -ne '> ' - )" selection - - if [ "$selection" -eq $((${#boards[@]} + 1)) ]; then - builds=(${boards[@]}) - else - builds="${boards[$((selection-1))]}" - fi -fi - -# Check to see if we are in a UEFI repository -# refuse to continue if we aren't -if [ ! -e BaseTools ] -then - echo "ERROR: we aren't in the UEFI directory." - echo " I can tell because I can't see the BaseTools directory" - exit 1 -fi - -EDK2_DIR="$PWD" -export VERBOSE - -if [[ "${EXTRA_OPTIONS[@]}" != *"FIRMWARE_VER"* ]]; then - if test -d .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then - FIRMWARE_VER=`git rev-parse --short HEAD` - if ! git diff-index --quiet HEAD --; then - FIRMWARE_VER="${FIRMWARE_VER}-dirty" - fi - EXTRA_OPTIONS=( ${EXTRA_OPTIONS[@]} "-D" FIRMWARE_VER=$FIRMWARE_VER ) - if [ $VERBOSE -eq 1 ]; then - echo "FIRMWARE_VER=$FIRMWARE_VER" - echo "EXTRA_OPTIONS=$EXTRA_OPTIONS" - fi - fi -fi - -uefishell - -if [ X"$TOOLCHAIN" = X"" ]; then - TOOLCHAIN=gcc -fi - -for board in "${builds[@]}" ; do - do_build -done - -result_print diff --git a/uefi-tools/uefi-build.sh.bash_completion b/uefi-tools/uefi-build.sh.bash_completion deleted file mode 100644 index f0a5305a..00000000 --- a/uefi-tools/uefi-build.sh.bash_completion +++ /dev/null @@ -1,24 +0,0 @@ -# bash completion for uefi-build.sh -# copy this file to /etc/bash_completion.d/uefi-build.s - -have uefi-build.sh && -_uefi-build.sh() -{ - local cur prev - - COMPREPLY=() - _get_comp_words_by_ref -n = cur - - _expand || return 0 - - COMPREPLY=( $( compgen -W '--help -b --build RELEASE DEBUG a5 a9 tc1 tc2 panda origen arndale rtsm_a9x4 rtsm_a15x1 rtsm_a15mpcore rtsm_aarch64 beagle all' -- "$cur" ) ) -} && -complete -F _uefi-build.sh uefi-build.sh - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/ueventd.common.rc b/ueventd.common.rc index b7dd505d..80652635 100644 --- a/ueventd.common.rc +++ b/ueventd.common.rc @@ -14,6 +14,7 @@ subsystem usbmisc /dev/hi_vdec 0660 system camera /dev/hi_venc 0660 system camera /dev/ion 0666 system graphics +/dev/dma_heap/linux,cma 0666 system graphics /dev/graphics/fb0 0666 system graphics /sys/devices/platform/ddr_devfreq/devfreq/ddr_devfreq min_freq 0644 system system diff --git a/vendor-package-ver.mk b/vendor-package-ver.mk new file mode 100644 index 00000000..be369eb1 --- /dev/null +++ b/vendor-package-ver.mk @@ -0,0 +1,4 @@ +HELPER_SCRIPT=./device/linaro/hikey/vendor-package-ver.sh +EXPECTED_LINARO_VENDOR_VERSION := $(shell $(HELPER_SCRIPT) ver) +VND_PKG_URL := $(shell $(HELPER_SCRIPT) url) +LINARO_VENDOR_PATH := vendor/linaro/ diff --git a/vendor-package-ver.sh b/vendor-package-ver.sh new file mode 100755 index 00000000..12f4a6f0 --- /dev/null +++ b/vendor-package-ver.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export EXPECTED_LINARO_VENDOR_VERSION=20220210 +export EXPECTED_LINARO_VENDOR_SHA=75efc8471f299f64716140712c0785b8e8aeaf5aa7e389a6f12f78ad4962420740da32f4535d795006e78c5f0b77a1cee8c168192a87f668103c00d87d480e6d +export VND_PKG_URL=https://releases.linaro.org/android/aosp-linaro-vendor-package/extract-linaro_devices-20220210.tgz + +if [ "$1" = "url" ]; then + echo $VND_PKG_URL +elif [ "$1" = "ver" ]; then + echo $EXPECTED_LINARO_VENDOR_VERSION +elif [ "$1" = "sha" ]; then + echo $EXPECTED_LINARO_VENDOR_SHA +fi diff --git a/vndk/Android.mk b/vndk/Android.mk deleted file mode 100644 index b6a4f74d..00000000 --- a/vndk/Android.mk +++ /dev/null @@ -1,28 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -define add-vndk-sp-lib -include $$(CLEAR_VARS) -LOCAL_MODULE := $1.vndk-sp -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_PREBUILT_MODULE_FILE := $$(TARGET_OUT)/lib/$1.so -LOCAL_MULTILIB := 32 -LOCAL_MODULE_TAGS := optional -LOCAL_INSTALLED_MODULE_STEM := $1.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_MODULE_RELATIVE_PATH := vndk-sp -include $$(BUILD_PREBUILT) - -include $$(CLEAR_VARS) -LOCAL_MODULE := $1.vndk-sp -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_PREBUILT_MODULE_FILE := $$(TARGET_OUT)/lib64/$1.so -LOCAL_MULTILIB := 64 -LOCAL_MODULE_TAGS := optional -LOCAL_INSTALLED_MODULE_STEM := $1.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_MODULE_RELATIVE_PATH := vndk-sp -include $$(BUILD_PREBUILT) -endef - -$(foreach lib,$(VNDK_SP_LIBRARIES),\ - $(eval $(call add-vndk-sp-lib,$(lib)))) diff --git a/wpan/Android.mk b/wpan/Android.mk deleted file mode 100644 index edb7b6f2..00000000 --- a/wpan/Android.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call first-makefiles-under,$(call my-dir)) diff --git a/wpan/README b/wpan/README deleted file mode 100644 index 3b452933..00000000 --- a/wpan/README +++ /dev/null @@ -1,18 +0,0 @@ -wpan.git contains the Bluetooth, FM code by Texas Instruments for -WiLink connectivity chipsets on OMAP Platforms - -Android.mk - Root Makefile calling all subdir makefiles -bt_sco_app - Command line application to send PCM configuruations to WL12xx chip(optional) -and connect to BT headset via SCO. -bt_voice_call_set - Derived from bt_sco_app for Modem purposes. -fmradio - Stack and Command line application for FM on WiLink chipsets -fmradio_omap3 - Derived from fmradio (older version) on OMAP3 platforms -README - This file -ti_st - - kfmapp/ - V4L2 FM application to be used with V4L2 drivers for FM on WL. - uim/ - User-Space Initilization Manager for TI Shared Transport Drivers (to be - used with kernel version 2.6.32 and below drivers) - uim-rfkill/ - Derived from uim/ to be used with K32 and above TI ST drivers. - uim-sysfs/ - User-Space Init Manager for TI Shared Transport Drivers (per kernel.org) -tools - - BluetoothSCOApp/ - BT SCO UI App for connect to BT headset via SCO diff --git a/wpan/ti-wpan-products.mk b/wpan/ti-wpan-products.mk deleted file mode 100644 index 8e720fba..00000000 --- a/wpan/ti-wpan-products.mk +++ /dev/null @@ -1,4 +0,0 @@ -# This file lists the firmware, software that are specific to -# WiLink connectivity chip on OMAPx platforms. - -PRODUCT_PACKAGES += uim diff --git a/wpan/uim/Android.mk b/wpan/uim/Android.mk deleted file mode 100644 index a7bd83c2..00000000 --- a/wpan/uim/Android.mk +++ /dev/null @@ -1,14 +0,0 @@ -#Android makefile for uim -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= uim.c - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/ - -LOCAL_MODULE := uim -LOCAL_PROPRIETARY_MODULE := true - -include $(BUILD_EXECUTABLE) - diff --git a/wpan/uim/Makefile b/wpan/uim/Makefile deleted file mode 100644 index 2790e79b..00000000 --- a/wpan/uim/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -MAKEFLAGS += --no-print-directory - -PREFIX ?= /usr -SBINDIR ?= $(PREFIX)/sbin -MANDIR ?= $(PREFIX)/share/man - -MKDIR ?= mkdir -p -INSTALL ?= install -CC ?= "gcc" - -CFLAGS ?= -O2 -g -CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration - -OBJS = uim.o -ALL = uim - -ifeq ($(V),1) -Q= -NQ=true -else -Q=@ -NQ=echo -endif - -all: $(ALL) - -VERSION_OBJS := $(filter-out version.o, $(OBJS)) - -%.o: %.c uim.h - @$(NQ) ' CC ' $@ - $(Q)$(CC) $(CFLAGS) -c -o $@ $< - -uim: $(OBJS) - @$(NQ) ' CC ' uim - $(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o uim - -check: - $(Q)$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc" - -install: uim - @$(NQ) ' INST uim' - $(Q)$(MKDIR) $(DESTDIR)$(SBINDIR) - $(Q)$(INSTALL) -m 755 -t $(DESTDIR)$(SBINDIR) uim - -clean: - $(Q)rm -f uim *.o *~ diff --git a/wpan/uim/uim.c b/wpan/uim/uim.c deleted file mode 100644 index 7f78f0c9..00000000 --- a/wpan/uim/uim.c +++ /dev/null @@ -1,562 +0,0 @@ -/* - * User Mode Init manager - For TI shared transport - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program;if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <string.h> -#include <signal.h> -#include <sys/ioctl.h> -#include <termios.h> -#include <poll.h> -#include <stdint.h> -#include <stdlib.h> -#include <sys/stat.h> -#include <sys/utsname.h> - -#include <unistd.h> -#include <time.h> - -#include "uim.h" - -/* Maintains the exit state of UIM*/ -static int exiting; -static int line_discipline; -static int dev_fd; - -/* BD address as string and a pointer to array of hex bytes */ -char uim_bd_address[BD_ADDR_LEN]; -bdaddr_t *bd_addr; - -/* kim Sysfs path */ -static char *sysfs_install_entry = INSTALL_SYSFS_ENTRY; -static char *sysfs_dev_name = DEV_NAME_SYSFS; -static char *sysfs_baud_rate = BAUD_RATE_SYSFS; -static char *sysfs_flow_ctrl = FLOW_CTRL_SYSFS; - -/*****************************************************************************/ -#ifdef UIM_DEBUG -/* Function to Read the firmware version - * module into the system. Currently used for - * debugging purpose, whenever the baud rate is changed - */ -void read_firmware_version(int dev_fd) -{ - int index = 0; - char resp_buffer[20] = { 0 }; - unsigned char buffer[] = { 0x01, 0x01, 0x10, 0x00 }; - - UIM_START_FUNC(); - UIM_VER(" wrote %d bytes", (int)write(dev_fd, buffer, 4)); - UIM_VER(" reading %d bytes", (int)read(dev_fd, resp_buffer, 15)); - - for (index = 0; index < 15; index++) - UIM_VER(" %x ", resp_buffer[index]); - - printf("\n"); -} -#endif - -void sysfs_entry_fallback(void) -{ - sysfs_install_entry = INSTALL_SYSFS_ENTRY_OLD; - sysfs_dev_name = DEV_NAME_SYSFS_OLD; - sysfs_baud_rate = BAUD_RATE_SYSFS_OLD; - sysfs_flow_ctrl = FLOW_CTRL_SYSFS_OLD; -} - -/*****************************************************************************/ -/* Function to read the HCI event from the given file descriptor - * - * This will parse the response received and returns error - * if the required response is not received - */ -int read_hci_event(int fd, unsigned char *buf, int size) -{ - int remain, rd; - int count = 0; - int reading = 1; - int rd_retry_count = 0; - struct timespec tm = {0, 50*1000*1000}; - - UIM_START_FUNC(); - - UIM_VER(" read_hci_event"); - if (size <= 0) - return -1; - - /* The first byte identifies the packet type. For HCI event packets, it - * should be 0x04, so we read until we get to the 0x04. */ - while (reading) { - rd = read(fd, buf, 1); - if (rd <= 0 && rd_retry_count++ < 4) { - nanosleep(&tm, NULL); - continue; - } else if (rd_retry_count >= 4) { - return -1; - } - - if (buf[0] == RESP_PREFIX) { - break; - } - } - count++; - - /* The next two bytes are the event code and parameter total length. */ - while (count < 3) { - rd = read(fd, buf + count, 3 - count); - if (rd <= 0) - return -1; - count += rd; - } - - /* Now we read the parameters. */ - if (buf[2] < (size - 3)) - remain = buf[2]; - else - remain = size - 3; - - while ((count - 3) < remain) { - rd = read(fd, buf + count, remain - (count - 3)); - if (rd <= 0) - return -1; - count += rd; - } - - return count; -} - -/* Function to read the Command complete event - * - * This will read the response for the change speed - * command that was sent to configure the UART speed - * with the custom baud rate - */ -static int read_command_complete(int fd, unsigned short opcode) -{ - command_complete_t resp; - - UIM_START_FUNC(); - - UIM_VER(" Command complete started"); - if (read_hci_event(fd, (unsigned char *)&resp, sizeof(resp)) < 0) { - UIM_ERR("Invalid response"); - return -1; - } - - /* Response should be an event packet */ - if (resp.uart_prefix != HCI_EVENT_PKT) { - UIM_ERR ("Error in response: not an event packet, 0x%02x!", - resp.uart_prefix); - return -1; - } - - /* Response should be a command complete event */ - if (resp.hci_hdr.evt != EVT_CMD_COMPLETE) { - /* event must be event-complete */ - UIM_ERR("Error in response: not a cmd-complete event,0x%02x!", - resp.hci_hdr.evt); - return -1; - } - - if (resp.hci_hdr.plen < 4) { - /* plen >= 4 for EVT_CMD_COMPLETE */ - UIM_ERR("Error in response: plen is not >= 4, but 0x%02x!", - resp.hci_hdr.plen); - return -1; - } - - if (resp.cmd_complete.opcode != (unsigned short)opcode) { - UIM_ERR("Error in response: opcode is 0x%04x, not 0x%04x!", - resp.cmd_complete.opcode, opcode); - return -1; - } - - UIM_DBG("Command complete done"); - return resp.status == 0 ? 0 : -1; -} - -/* Function to set the default baud rate - * - * The default baud rate of 115200 is set to the UART from the host side - * by making a call to this function.This function is also called before - * making a call to set the custom baud rate - */ -static int set_baud_rate(int dev_fd) -{ - UIM_START_FUNC(); - struct termios ti; - - tcflush(dev_fd, TCIOFLUSH); - - /* Get the attributes of UART */ - if (tcgetattr(dev_fd, &ti) < 0) { - UIM_ERR(" Can't get port settings"); - return -1; - } - - /* Change the UART attributes before - * setting the default baud rate*/ - cfmakeraw(&ti); - - ti.c_cflag |= 1; - ti.c_cflag |= CRTSCTS; - - /* Set the attributes of UART after making - * the above changes - */ - tcsetattr(dev_fd, TCSANOW, &ti); - - /* Set the actual default baud rate */ - cfsetospeed(&ti, B115200); - cfsetispeed(&ti, B115200); - tcsetattr(dev_fd, TCSANOW, &ti); - - tcflush(dev_fd, TCIOFLUSH); - UIM_DBG("set_baud_rate() done"); - - return 0; -} - - -/* Function to set the UART custom baud rate. - * - * The UART baud rate has already been - * set to default value 115200 before calling this function. - * The baud rate is then changed to custom baud rate by this function*/ -static int set_custom_baud_rate(int dev_fd, int baud_rate, int flow_ctrl) -{ - UIM_START_FUNC(); - - struct termios ti; - struct termios2 ti2; - - tcflush(dev_fd, TCIOFLUSH); - /* Get the attributes of UART */ - if (tcgetattr(dev_fd, &ti) < 0) { - UIM_ERR(" Can't get port settings"); - return -1; - } - - /*Set the UART flow control */ - if (flow_ctrl) - ti.c_cflag |= CRTSCTS; - else - ti.c_cflag &= ~CRTSCTS; - - /* - * Set the parameters associated with the UART - * The change will occur immediately by using TCSANOW - */ - if (tcsetattr(dev_fd, TCSANOW, &ti) < 0) { - UIM_ERR(" Can't set port settings"); - return -1; - } - - tcflush(dev_fd, TCIOFLUSH); - - /*Set the actual baud rate */ - ioctl(dev_fd, TCGETS2, &ti2); - ti2.c_cflag &= ~CBAUD; - ti2.c_cflag |= BOTHER; - ti2.c_ospeed = baud_rate; - ioctl(dev_fd, TCSETS2, &ti2); - - return 0; -} - -/* Function to configure the UART - * on receiving a notification from the ST KIM driver to install the line - * discipline, this function does UART configuration necessary for the STK - */ -int st_uart_config(unsigned char install) -{ - int ldisc, len, fd, flow_ctrl; - unsigned char buf[UART_DEV_NAME_LEN]; - uim_speed_change_cmd cmd; - char uart_dev_name[UART_DEV_NAME_LEN]; - unsigned int cust_baud_rate; - - uim_bdaddr_change_cmd addr_cmd; - - UIM_START_FUNC(); - - if (install == '1') { - memset(buf, 0, UART_DEV_NAME_LEN); - fd = open(sysfs_dev_name, O_RDONLY); - if (fd < 0) { - UIM_ERR("Can't open %s", sysfs_dev_name); - return -1; - } - len = read(fd, buf, UART_DEV_NAME_LEN); - if (len < 0) { - UIM_ERR("read err (%s)", strerror(errno)); - close(fd); - return len; - } - sscanf((const char*)buf, "%s", uart_dev_name); - close(fd); - - memset(buf, 0, UART_DEV_NAME_LEN); - fd = open(sysfs_baud_rate, O_RDONLY); - if (fd < 0) { - UIM_ERR("Can't open %s", sysfs_baud_rate); - return -1; - } - len = read(fd, buf, UART_DEV_NAME_LEN); - if (len < 0) { - UIM_ERR("read err (%s)", strerror(errno)); - close(fd); - return len; - } - close(fd); - sscanf((const char*)buf, "%d", &cust_baud_rate); - - memset(buf, 0, UART_DEV_NAME_LEN); - fd = open(sysfs_flow_ctrl, O_RDONLY); - if (fd < 0) { - UIM_ERR("Can't open %s", sysfs_flow_ctrl); - close(fd); - return -1; - } - len = read(fd, buf, UART_DEV_NAME_LEN); - if (len < 0) { - UIM_ERR("read err (%s)", strerror(errno)); - close(fd); - return len; - } - close(fd); - sscanf((const char*)buf, "%d", &flow_ctrl); - - UIM_VER(" signal received, opening %s", uart_dev_name); - - dev_fd = open(uart_dev_name, O_RDWR); - if (dev_fd < 0) { - UIM_ERR("Can't open %s", uart_dev_name); - return -1; - } - - /* - * Set only the default baud rate. - * This will set the baud rate to default 115200 - */ - if (set_baud_rate(dev_fd) < 0) { - UIM_ERR("set_baudrate() failed"); - close(dev_fd); - return -1; - } - - fcntl(dev_fd, F_SETFL,fcntl(dev_fd, F_GETFL) | O_NONBLOCK); - /* Set only the custom baud rate */ - if (cust_baud_rate != 115200) { - - UIM_VER("Setting speed to %d", cust_baud_rate); - /* Forming the packet for Change speed command */ - cmd.uart_prefix = HCI_COMMAND_PKT; - cmd.hci_hdr.opcode = HCI_HDR_OPCODE; - cmd.hci_hdr.plen = sizeof(unsigned int); - cmd.speed = cust_baud_rate; - - /* Writing the change speed command to the UART - * This will change the UART speed at the controller - * side - */ - len = write(dev_fd, &cmd, sizeof(cmd)); - if (len < 0) { - UIM_ERR("Failed to write speed-set command"); - close(dev_fd); - return -1; - } - - /* Read the response for the Change speed command */ - if (read_command_complete(dev_fd, HCI_HDR_OPCODE) < 0) { - close(dev_fd); - return -1; - } - - UIM_VER("Speed changing to %d, %d", cust_baud_rate, flow_ctrl); - /* Set the actual custom baud rate at the host side */ - if (set_custom_baud_rate(dev_fd, cust_baud_rate, flow_ctrl) < 0) { - UIM_ERR("set_custom_baud_rate() failed"); - close(dev_fd); - return -1; - } - - /* Set the uim BD address */ - if (uim_bd_address[0] != 0) { - - memset(&addr_cmd, 0, sizeof(addr_cmd)); - /* Forming the packet for change BD address command*/ - addr_cmd.uart_prefix = HCI_COMMAND_PKT; - addr_cmd.hci_hdr.opcode = WRITE_BD_ADDR_OPCODE; - addr_cmd.hci_hdr.plen = sizeof(bdaddr_t); - memcpy(&addr_cmd.addr, bd_addr, sizeof(bdaddr_t)); - - /* Writing the change BD address command to the UART - * This will change the change BD address at the controller - * side - */ - len = write(dev_fd, &addr_cmd, sizeof(addr_cmd)); - if (len < 0) { - UIM_ERR("Failed to write BD address command"); - close(dev_fd); - return -1; - } - - /* Read the response for the change BD address command */ - if (read_command_complete(dev_fd, WRITE_BD_ADDR_OPCODE) < 0) { - close(dev_fd); - return -1; - } - UIM_VER("BD address changed to %s", uim_bd_address); - } -#ifdef UIM_DEBUG - read_firmware_version(dev_fd); -#endif - } - - /* After the UART speed has been changed, the IOCTL is - * is called to set the line discipline to N_TI_WL - */ - ldisc = N_TI_WL; - if (ioctl(dev_fd, TIOCSETD, &ldisc) < 0) { - UIM_ERR(" Can't set line discipline"); - close(dev_fd); - return -1; - } - UIM_DBG("Installed N_TI_WL Line displine"); - } - else { - UIM_DBG("Un-Installed N_TI_WL Line displine"); - /* UNINSTALL_N_TI_WL - When the Signal is received from KIM */ - /* closing UART fd */ - close(dev_fd); - } - return 0; -} - -/* Function to convert the BD address from ascii to hex value */ -bdaddr_t *strtoba(const char *str) -{ - const char *ptr = str; - int i; - - uint8_t *ba = malloc(sizeof(bdaddr_t)); - if (!ba) - return NULL; - - for (i = 0; i < 6; i++) { - ba[i] = (uint8_t) strtol(ptr, NULL, 16); - if (i != 5 && !(ptr = strchr(ptr, ':'))) - ptr = ":00:00:00:00:00"; - ptr++; - } - - return (bdaddr_t *) ba; -} - -/*****************************************************************************/ -int main(int argc, char *argv[]) -{ - int st_fd, err,trials; - unsigned char install; - struct pollfd p; - - UIM_START_FUNC(); - err = 0; - trials = 5; - - /* Parse the user input */ - if ((argc > 2)) { - UIM_ERR("Invalid arguements"); - UIM_ERR("Usage: uim <bd address>"); - return -1; - } - if (argc == 2) { - if (strlen(argv[2]) != BD_ADDR_LEN) { - UIM_ERR("Usage: uim XX:XX:XX:XX:XX:XX"); - return -1; - } - /* BD address passed as string in xx:xx:xx:xx:xx:xx format */ - strncpy(uim_bd_address, argv[2], sizeof(uim_bd_address)); - bd_addr = strtoba(uim_bd_address); - } - - line_discipline = N_TI_WL; - - /* sysfs entry may get populated after service is started so we retry if it fails*/ - while (trials > 0) { - st_fd = open(sysfs_install_entry, O_RDONLY); - if(st_fd > 0) - break; - if (trials == 3) - sysfs_entry_fallback(); - else - usleep(500000); - --trials; - } - if (st_fd < 0) { - UIM_DBG("unable to open %s(%s)", sysfs_install_entry, strerror(errno)); - return -1; - } - -RE_POLL: - /* read to start proper poll */ - err = read(st_fd, &install, 1); - /* special case where bluetoothd starts before the UIM, and UIM - * needs to turn on bluetooth because of that. - */ - if ((err > 0) && install == '1') { - UIM_DBG("install set previously..."); - st_uart_config(install); - } - - UIM_DBG("begin polling..."); - - memset(&p, 0, sizeof(p)); - p.fd = st_fd; - p.events = POLLERR | POLLPRI; - - while (!exiting) { - p.revents = 0; - err = poll(&p, 1, -1); - UIM_DBG("poll broke due to event %d(PRI:%d/ERR:%d)\n", p.revents, POLLPRI, POLLERR); - if (err < 0 && errno == EINTR) - continue; - if (err) - break; - } - - close(st_fd); - st_fd = open(sysfs_install_entry, O_RDONLY); - if (st_fd < 0) { - UIM_DBG("unable to open %s (%s)", sysfs_install_entry, strerror(errno)); - return -1; - } - - if (!exiting) - { - err = read(st_fd, &install, 1); - UIM_DBG("read %c from install \n", install); - if (err > 0) - st_uart_config(install); - goto RE_POLL; - } - - close(st_fd); - return 0; -} diff --git a/wpan/uim/uim.h b/wpan/uim/uim.h deleted file mode 100644 index dc9c5b17..00000000 --- a/wpan/uim/uim.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * User Mode Init manager - For shared transport - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program;if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef UIM_H -#define UIM_H - -/* the line discipline ideally should be coming - * from tty.h - */ -#define N_TI_WL 22 - -/* Paramaters to set the baud rate*/ -#define FLOW_CTL 0x0001 -#define ARM_NCCS 19 - -#ifndef TCGETS2 -#define TCGETS2 _IOR('T',0x2A, struct termios2) -#endif -#ifndef TCSETS2 -#define TCSETS2 _IOW('T',0x2B, struct termios2) -#endif - -/*HCI Command and Event information*/ -#define HCI_HDR_OPCODE 0xff36 -#define WRITE_BD_ADDR_OPCODE 0xFC06 -#define RESP_PREFIX 0x04 -#define MAX_TRY 10 - -/* HCI Packet types */ -#define HCI_COMMAND_PKT 0x01 -#define HCI_EVENT_PKT 0x04 - -/* HCI command macros*/ -#define HCI_EVENT_HDR_SIZE 2 -#define HCI_COMMAND_HDR_SIZE 3 -#define HCI_COMMAND_HDR_SIZE 3 - -/* HCI event macros*/ -#define EVT_CMD_COMPLETE_SIZE 3 -#define EVT_CMD_STATUS_SIZE 4 -#define EVT_CMD_COMPLETE 0x0E -#define EVT_CMD_STATUS 0x0F - -/* use it for string lengths and buffers */ -#define UART_DEV_NAME_LEN 32 -/* BD address length in format xx:xx:xx:xx:xx:xx */ -#define BD_ADDR_LEN 17 - -/* the sysfs entries with device configuration set by - * shared transport driver - */ -#define INSTALL_SYSFS_ENTRY "/sys/devices/platform/kim/install" -#define DEV_NAME_SYSFS "/sys/devices/platform/kim/dev_name" -#define BAUD_RATE_SYSFS "/sys/devices/platform/kim/baud_rate" -#define FLOW_CTRL_SYSFS "/sys/devices/platform/kim/flow_cntrl" - -#define INSTALL_SYSFS_ENTRY_OLD "/sys/devices/kim/install" -#define DEV_NAME_SYSFS_OLD "/sys/devices/kim/dev_name" -#define BAUD_RATE_SYSFS_OLD "/sys/devices/kim/baud_rate" -#define FLOW_CTRL_SYSFS_OLD "/sys/devices/kim/flow_cntrl" - -#define VERBOSE -/*Debug logs*/ -#define UIM_ERR(fmt, arg...) printf("uim:"fmt"\n" , ##arg) -#if defined(UIM_DEBUG) /* limited debug messages */ -#define UIM_START_FUNC() printf("uim: Inside %s", __FUNCTION__) -#define UIM_DBG(fmt, arg...) printf("uim:"fmt"\n" , ## arg) -#define UIM_VER(fmt, arg...) -#elif defined(VERBOSE) /* very verbose */ -#define UIM_START_FUNC() printf("uim:@ %s\n", __FUNCTION__) -#define UIM_DBG(fmt, arg...) printf("uim:"fmt"\n" , ## arg) -#define UIM_VER(fmt, arg...) printf("uim:"fmt"\n" , ## arg) -#else /* error msgs only */ -#define UIM_START_FUNC() -#define UIM_DBG(fmt, arg...) -#define UIM_VER(fmt, arg...) -#endif - -/* HCI command header*/ -typedef struct { - uint16_t opcode; /* OCF & OGF */ - uint8_t plen; -} __attribute__ ((packed)) hci_command_hdr; - -/* HCI event header*/ -typedef struct { - uint8_t evt; - uint8_t plen; -} __attribute__ ((packed)) hci_event_hdr; - -/* HCI command complete event*/ -typedef struct { - uint8_t ncmd; - uint16_t opcode; -} __attribute__ ((packed)) evt_cmd_complete; - -/* HCI event status*/ -typedef struct { - uint8_t status; - uint8_t ncmd; - uint16_t opcode; -} __attribute__ ((packed)) evt_cmd_status; - -/* HCI Event structure to set the cusrom baud rate*/ -typedef struct { - uint8_t uart_prefix; - hci_event_hdr hci_hdr; - evt_cmd_complete cmd_complete; - uint8_t status; - uint8_t data[16]; -} __attribute__ ((packed)) command_complete_t; - -/* HCI Command structure to set the cusrom baud rate*/ -typedef struct { - uint8_t uart_prefix; - hci_command_hdr hci_hdr; - uint32_t speed; -} __attribute__ ((packed)) uim_speed_change_cmd; - -/* BD address structure to set the uim BD address*/ -typedef struct { - unsigned char b[6]; -} __attribute__((packed)) bdaddr_t; - -/* HCI Command structure to set the uim BD address*/ -typedef struct { - uint8_t uart_prefix; - hci_command_hdr hci_hdr; - bdaddr_t addr; -} __attribute__ ((packed)) uim_bdaddr_change_cmd;\ - -#endif /* UIM_H */ |