Jump to content

Nintendo Switch (nintendo-nx): Difference between revisions

From postmarketOS Wiki
No edit summary
Exkc (talk | contribs)
No edit summary
 
(13 intermediate revisions by 8 users not shown)
Line 6: Line 6:
| imagecaption =
| imagecaption =
| releaseyear = 2017
| releaseyear = 2017
| originalsoftware = Nintendo Switch system software 1.0.0 (upgradeable to 12.1.0)
| originalsoftware = Horizon
| chipset = Nvidia Tegra X1
| originalversion = 1.0.0
| extendedversion =  16.0.3
| chipset = Nvidia Tegra X1 (T210)
| cpu = Quad-core 1.02 GHz Cortex-A57
| cpu = Quad-core 1.02 GHz Cortex-A57
| gpu = Maxwell
| gpu = Maxwell
Line 14: Line 16:
| memory = 4 GB
| memory = 4 GB
| architecture = aarch64
| architecture = aarch64
| n-android = ✔
| status_usbnet =  
| status_usbnet =  
| status_flashing =  
| status_flashing =  
Line 33: Line 34:
| status_sms = -
| status_sms = -
| status_calls = -
| status_calls = -
| type= handheld
| status = Kernel and bootloader compiles, but freezes on boot
| status = Kernel and bootloader compiles, but freezes on boot
| booting = no
| booting = no
Line 108: Line 110:
* [https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/ another tutorial for booting Linux]
* [https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/ another tutorial for booting Linux]
* [https://lakka-switch.github.io/documentation/ Lakka (distro) running on Nintendo Switch]
* [https://lakka-switch.github.io/documentation/ Lakka (distro) running on Nintendo Switch]
[[Category:Game Console]]

Latest revision as of 21:29, 19 September 2024

This device is marked as not booting.
Status: Kernel and bootloader compiles, but freezes on boot
Nintendo Switch
Manufacturer Nintendo
Name Switch
Codename nintendo-nx
Released 2017
Type handheld
Hardware
Chipset Nvidia Tegra X1 (T210)
CPU Quad-core 1.02 GHz Cortex-A57
GPU Maxwell
Display 1280x720
Storage 32 GB
Memory 4 GB
Architecture aarch64
Software
Original software Horizon
Original version 1.0.0
Extended version 16.0.3
postmarketOS
Category testing
Pre-built images no


Contributors

  • zhuowei
  • the Fail0verflow developers (mainline kernel and bootloader port)

Maintainer(s)

  • zhuowei

Users owning this device


Software used

This uses Fail0verflow's Linux port for the Switch. They ported the mainline 4.16 kernel to the Switch, and ported Coreboot and U-Boot as the bootloader. They also developed a tool, ShofEL2, to boot the Switch to Linux from its recovery mode.

So the boot process is this:

  • Switch boots to Tegra RCM flashing mode over USB
  • ShofEL2 boots Coreboot
  • Coreboot initializes hardware and launches U-Boot as its payload
  • U-Boot starts SDP flashing mode over USB
  • imx-usb-loader loads Linux kernel, device tree, and U-Boot script via SDP
  • U-Boot script decompresses and boots Linux

What works

  • Kernel compiles
  • U-Boot and Coreboot compiles
  • The ShofEL2 tool added to flashing methods in `pmbootstrap flasher` and can boot compiled Coreboot bootloader to USB SDP loading mode

What does not work

Everything.

Coreboot, U-Boot, and shofel2 built in pmbootstrap seems to work on their own: u-boot correctly enters the USB SDP flashing mode, and imx-usb-loader can interact with it.

The kernel itself also seems to work on its own: when booted with a known good coreboot/u-boot it does start, although it then immediately panics since no initramfs is provided by the known good bootloader and there's no rootfs on my test SD card.

However, attempting to boot the kernel with initramfs support freezes the device, either with coreboot/u-boot built with pmbootstrap or with the known good coreboot/u-boot. Unfortunately, postmarketOS needs the initramfs to setup encryption, so this will need to be addressed.

How to enter flash mode

The Switch, like some other Nvidia Tegra devices, uses the Tegra RCM flashing mode.

First, Pin 10 (the rightmost pin) needs to be grounded on the right JoyCon. To do this, one can use a wire, a paperclip, or a 3D printed jig. Guides can be found here.

Next, hold down Volume +, then press Power. The device should boot into RCM mode: the screen should stay blank, and "lsusb" should show:

$ lsusb
Bus 002 Device 078: ID 0955:7321 NVidia Corp. 


Installation

postmarketOS needs to be flashed to a microSD using "./pmbootstrap.py install --sdcard".

This device only supports tethered boot, so on each boot, one must enter flashing mode, then run "pmbootstrap flasher boot".

Debugging

This device exposes two serial ports, one in each JoyCon slot: Fail0verflow's Linux kernel uses the port in the left JoyCon slot. The pinout can be found here. I don't have a serial adapter, so I'm examining alternative kernel debugging methods.

See also