Homebrew [Release] Linux for the 3DS

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
293
Trophies
0
Age
52
XP
722
Country
United States
IR support sounds pretty useless because nobody really does have an IR receiver, and most modern TVs just use other protocols (I've mostly seen BLE recently). As for WiFi, the chip in the 3DS has already been identified (by the 3dbrew people) as an AR6014 that communicates through SDIO, but I haven't really confirmed this hardware, nor really managed to test it (whenever I added the chip to the device tree it just would pretend it wasn't there, and yes the driver was compiled into the kernel).

Really, right now I'm focusing more on SD performance and protocol improvements. I'm debating as to whether arm9linuxfw should just expose a dumb block device you can read/write from, or a full MMC interface to send commands to.

Block device pros:
- Simpler to implement in the ARM9 side
- Already well tested and known to work
- It can use DMA in the future to process requests asynchronously

Block device cons:
- It is it's own non-standard device (currently /dev/ctr_mmc_{a,b} for NAND and SD)
- It won't cache the data that was read for some reason (it used to do so in 4.20)
- Harder to implement and test in the ARM11 side
- Extremely hard to implement card hotplugging

MMC pros:
- Uses a standard device interface (/dev/mmcblk)
- Linux already has a ton of code to handle MMC cards, including proper timeouts
- Has the best SD card configuration possible
- Can easily detect card removal and insertion
- Can dump CSD/CID, could even be used to unlock password locked NANDs (GW bricked consoles) in place, using nothing more than an ntrboot card

MMC cons:
- Complex to implement in the ARM9 side, it would need a passthrough for every single functionality the MMC controller provides
- Every single command Linux wants to send to the card involves a PXI transaction (this could be mitigated a bit with some tricks)
- I'm not sure how well it would handle a single controller that handles both an eMMC chip and an SD card
- There isn't a single example / skeleton driver for MMC hosts, so I'd have to understand an existing driver (and the hardware it works with), and modify it to fit with the 3DS' chip (there is an existing TMIO driver, which is very close to the chip the 3DS uses, but Linux can't directly access it because it's gated by the ARM9)
Isn't the kernel on the ARM9 and the SDIO only visible on ARM11?

that's a problem, yes

I feel using it as an actual MMC device would be more useful too, so probably that?

I also meant later on, I was planning on focusing on bugfixes too.
 

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
2,785
Country
Uruguay
Isn't the kernel on the ARM9 and the SDIO only visible on ARM11?

that's a problem, yes

I feel using it as an actual MMC device would be more useful too, so probably that?

I also meant later on, I was planning on focusing on bugfixes too.

Um, no, actually there are two MMC controllers on the system, similar to the DSi. One is only mapped in the ARM9 address space and can access the eMMC and SD cards (regular MMC/SD protocol), the other is mapped to both CPUs, is used for WiFi and talks over SDIO.

The Linux kernel itself is running in the ARM11 core, if that's what you meant. And yeah, I plan to implement a full blown MMC controller, that way I can reuse code for NAND/SD and the WiFi controller (apparently they have exactly the same register layout, they only differ in how they can be accessed and how the hardware attached to them should be initialized). If anyone knows about a simple UART device that can simplify testing, that'd be super useful (preferably one that's not too invasive).
 

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
293
Trophies
0
Age
52
XP
722
Country
United States
Tailor images to your needs, develop on the system and find bugs easier. Chainload images are limited in size due to RAM constraints, so they'd need to be tailored anyway.
 

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
293
Trophies
0
Age
52
XP
722
Country
United States
I neglected to mention: the toolchain made by buildroot is compatible with the other pieces of Linux 3DS (except arm9linuxfw.) You will, however, have to edit the builder SH file for the Linux kernel to change the toolchain path.
 

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
2,785
Country
Uruguay
Yeah, @Wolfvak and I took it over, I work on the frontend and buildroot and such, @Wolfvak works on the bare-metal, hardware and kernel sides of things.

To be fair I didn't "take it over", since I never asked permission from xerpi or anything. I just forked his work, rewrote the ARM9 firmware that runs on the background and added a ton of new drivers (and fixed some old ones).

Someone still needs to build a proper distro for it, and I don't think buildroot will cut it for too long.
 
  • Like
Reactions: KidNezha

ParzivalWolfram

Well-Known Member
Member
Joined
Jun 28, 2017
Messages
293
Trophies
0
Age
52
XP
722
Country
United States
To be fair I didn't "take it over", since I never asked permission from xerpi or anything. I just forked his work, rewrote the ARM9 firmware that runs on the background and added a ton of new drivers (and fixed some old ones).

Someone still needs to build a proper distro for it, and I don't think buildroot will cut it for too long.
I've been thinking about that, actually. I need Wi-Fi access and a working mouse driver to do that, though...

--------------------- MERGED ---------------------------

I saw that, yeah. Not gonna change it, though.
 
General chit-chat
Help Users
    AliceCE @ AliceCE: