Hookup FlatMemoryManager for SMMU into SoC

The SMMU is used to control the mappings of peripherals such as the VIC
and NVDEC.
This commit is contained in:
Billy Laws 2021-10-25 22:54:03 +01:00 committed by PixelyIon
parent 97dc053ffd
commit a0c57256cc
4 changed files with 30 additions and 1 deletions

View File

@ -135,6 +135,7 @@ add_library(skyline SHARED
${source_DIR}/skyline/gpu/presentation_engine.cpp
${source_DIR}/skyline/gpu/interconnect/command_executor.cpp
${source_DIR}/skyline/gpu/interconnect/command_nodes.cpp
${source_DIR}/skyline/soc/smmu.cpp
${source_DIR}/skyline/soc/host1x/syncpoint.cpp
${source_DIR}/skyline/soc/gm20b/channel.cpp
${source_DIR}/skyline/soc/gm20b/gpfifo.cpp

View File

@ -3,16 +3,18 @@
#pragma once
#include "soc/smmu.h"
#include "soc/host1x.h"
#include "soc/gm20b/gpfifo.h"
namespace skyline::soc {
/**
* @brief An interface into all emulated components of the Tegra X1 SoC
* @note Refer to the Tegra X1 Processor Block Diagram (1.2) for more information
* @note Refer to the Tegra X1 Processor Block Diagram (1.2) in the TRM for more information
*/
class SOC {
public:
SMMU smmu;
host1x::Host1X host1x;
SOC(const DeviceState &state) {}

View File

@ -0,0 +1,10 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include <common/address_space.inc>
#include "smmu.h"
namespace skyline {
template class FlatAddressSpaceMap<u32, 0, u8 *, nullptr, true, soc::SmmuAddressSpaceBits>;
template class FlatMemoryManager<u32, 0, soc::SmmuAddressSpaceBits>;
}

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
#pragma once
#include <common/address_space.h>
namespace skyline::soc {
static constexpr u8 SmmuAddressSpaceBits{32}; //!< The size of the SMMU AS in bits
/**
* @brief The SMMU (System Memory Management Unit) class handles mapping between the host1x peripheral virtual address space and an application's address space
* @note The SMMU is implemented entirely as a template specialization over FlatMemoryManager
*/
using SMMU = FlatMemoryManager<u32, 0, SmmuAddressSpaceBits>;
}