Coder Social home page Coder Social logo

mirage-rs / mirage Goto Github PK

View Code? Open in Web Editor NEW
47.0 5.0 4.0 386 KB

Reimplementation of the Nintendo Switch firmware

License: Other

Rust 99.44% RenderScript 0.01% Assembly 0.56%
mirage nintendo-switch switch nintendo-hacking rust rust-lang rust-embedded rust-os osdev kernel

mirage's People

Contributors

stupremee avatar vbe0201 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mirage's Issues

Implement SE driver

For cryptographic operations, an implementation of a driver for the Tegra Security Engine is required.

Should be implemented as the libswitch::se module.

Implementation

The Security Engine has a whole bunch of registers (see Switchbrew) mapped to address 0x70012000. The driver should feature a general API for checking error registers, triggering interrupts, setting keyslots and keyslot flags, as well as a Secure AES API and an RSA API for crypto operations, a SHA256 Hash API, and an RNG API for random data generation.

Resources

Storage/Filesystem code?

Since RCM payloads are limited in size, it wouldn't make much sense to try to fit everything, including future crates and changes, into it.

Thus, we need the functionality to

  • mount and unmount SD cards

  • read/write files

  • process those in Rust code

and the same aspects for the Switch's internal storage, the eMMC.

This is probably out of scope for libswitch as it isn't totally Switch/Tegra210-related so a separate crate with no_std capability would be adequate.

Thus, we don't have std::fs and need a partial replacement for it. Since Switch only supports Fat32 and exFat by extension, https://github.com/sunriseos/libfat can be used for that. It doesn't support exFat, but this isn't high priority for now.

Once this is implemented, it can be used for chainloading from the SD card.

Implement libswitch::power module

This is the tracking issue for the libswitch::power module containing drivers for the Switch's TI BQ24193, the Maxim 17050, and the Maxim 77620.

Required to complete #1.

Implementation

Max77620 driver has the highest priority. The others are nice to have, however low priority at the moment.

BQ24193

This is used for battery charging and should provide at least a function to retrieve the value (i16) of one of the following device properties, represented in an enum:

/// Representation of the BQ24193 device properties.
pub enum Properties {
    InputVoltageLimit,
    InputCurrentLimit,
    SystemMinimumVoltage,
    FastChargeCurrentLimit,
    ChargeVoltageLimit,
    RechargeThreshold,
    ThermalRegulation,
    ChargeStatus,
    TempStatus,
    DevId,
    ProductNumber,
}

These are to be retrieved over I2C. See the Technical Reference for details.

Max17050

Used for fuel gauging. Similar to the BQ24193, this has a similar system of retrieving values for certain device properties. The enum would however contain different members (notably a whole bunch more) with different values. See Technical Reference for details.

Max77620

Used for PMIC stuff. Hence, the driver should contain an abstraction of the device that holds its ID and the corresponding methods for configuring and managing the regulators which is done via I2C.

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.