linux-3ds / firm_linux_loader

FIRM Linux Loader for the Nintendo 3DS
GNU General Public License v2.0
69 stars 8 forks source link

Enable additional FCRAM #11

Closed nickdesaulniers closed 3 years ago

nickdesaulniers commented 3 years ago

The LGR models (new 3DS, new 3DS XL, new 2DS XL) all support double the capacity of FCRAM; 250MiB.

The process in plain English:

  1. Interrupt ID #88 is enabled.
  2. The clock speed is raised to 804Mhz.
  3. The additional FCRAM and L2 cache are enabled.
  4. Delay of 403 cycles.
  5. Spin in a Wait For Interrupt (WFI) loop until the "SOC mode" changes.
  6. Acknowledge the interrupt.
  7. Clear the interrupt.

Thanks to @profi200 and the open_agb_firm project which was referenced extensively.

A change to the DTB file is necessary to inform the kernel that additional physical memory is available; separate from this commit.

Once enabled, in userspace you can check the amount of physical memory available via:

$ mount -t proc /proc $ less /proc/meminfo

From here, we can enable the additional 2 LGR cores, but it's not required to make use of the additional FCRAM.

See photos at https://github.com/linux-3ds/linux/issues/1#issuecomment-815382458.

nickdesaulniers commented 3 years ago

Anecdotally, it felt like this booted much faster. Probably from ~3x clock rate. Oh, I should upload the DTS change, too.