Leapster Explorer: GPIO subsystem

From eLinux.org
Revision as of 06:44, 28 August 2010 by Reggie (talk | contribs)
Jump to: navigation, search

This is a short article on using the lf1000-gpio subsystem. This is used internally by /etc/init.d/rcS and other system scripts to start the explorer in different states via emerald-boot.

All of the magic happens via /sys/devices/platform/lf1000-gpio/ using cat you can find out the values of these registers, this is pretty much what emerald-boot does to tell itself how it should try and boot and /etc/rcS uses this technique, again to setup the system for the different types of boot (mainly starting only the appropriate modules/services that are needed.

here is a list of the registers:


As you can see there are a lot of them, we are only really interested in a few at this moment:

# this is how the system works out whether its booting a didj, explorer or LF Dev board(s)
# this is how rcS/EB knows which boot type it should use and which set of scripts to run once the kernel is loaded
# this is how it knows where it booted from (Nor,Nand,USB,UART)
# this is how the system differentiates between cart types (Game,MFG cart)
# this is how the system determines what speed the cpu should run at
# I think this tells the system whether the kernel panic'd or not
# whether it was a warm or cold boot?
# the type boot requested from the kernel
# how the system shutdown the last time

lets break that down a bit further:


The system uses board ID at compile time as well as boot, this is crucial to the system as it tells it which board type and consequently which types of boot it can perform, for the didj this will be nand or uart, for the explorer it will be nor,usb or uart. At compile time CONFIG_BOARD_ID is crucial for the system to know how the gpio pins are configured for the buttons.


this is how the system partly determines which set of scripts it should run at boot up via rcS, valid values are:

PLAY, RECOVERY (there may be more, I will update as I find them)

I believe this also tells emerald boot whether to boot normally or from USB for recovery purposes


This is how the system knows which method was used to boot, as mentioned in board_id, valid values for the explorer are:

and for the didj:


The explorer and didj systems use 2 types of cartridge, a normal game cart of a MFG cart, with the latter being able to perform system recovery, cart_id is how the system can tell the difference between cart types

This is a WIP., more to follow.