Leapster Explorer: GPIO subsystem

From eLinux.org
Revision as of 05:37, 28 August 2010 by Reggie (talk | contribs) (Created page with '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 eme…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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:


/sys/devices/platform/lf1000-gpio/board_id
/sys/devices/platform/lf1000-gpio/boot_image
/sys/devices/platform/lf1000-gpio/boot_source
/sys/devices/platform/lf1000-gpio/bus/
/sys/devices/platform/lf1000-gpio/cart_id
/sys/devices/platform/lf1000-gpio/cpu_freq_in_hz
/sys/devices/platform/lf1000-gpio/driver/
/sys/devices/platform/lf1000-gpio/memcfg
/sys/devices/platform/lf1000-gpio/memclkdelay
/sys/devices/platform/lf1000-gpio/memcontrol
/sys/devices/platform/lf1000-gpio/memdqsindelay
/sys/devices/platform/lf1000-gpio/memdqsoutdelay
/sys/devices/platform/lf1000-gpio/memrefresh
/sys/devices/platform/lf1000-gpio/memtime0
/sys/devices/platform/lf1000-gpio/memtime1
/sys/devices/platform/lf1000-gpio/modalias
/sys/devices/platform/lf1000-gpio/pad_strength_bus
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_a_high
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_a_low
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_b_high
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_b_low
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_c_high
/sys/devices/platform/lf1000-gpio/pad_strength_gpio_c_low
/sys/devices/platform/lf1000-gpio/panic
/sys/devices/platform/lf1000-gpio/power
/sys/devices/platform/lf1000-gpio/pullup_enable_gpio_a
/sys/devices/platform/lf1000-gpio/pullup_enable_gpio_b
/sys/devices/platform/lf1000-gpio/pullup_enable_gpio_c
/sys/devices/platform/lf1000-gpio/request
/sys/devices/platform/lf1000-gpio/shutdown
/sys/devices/platform/lf1000-gpio/subsystem/
/sys/devices/platform/lf1000-gpio/touchscreen
/sys/devices/platform/lf1000-gpio/uevent
/sys/devices/platform/lf1000-gpio/user_0

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

/sys/devices/platform/lf1000-gpio/board_id # this is how the system works out whether its booting a didj, 

explorer or LF Dev board(s)

/sys/devices/platform/lf1000-gpio/boot_image # this is how rcS/EB knows which boot type it should use and which set of scripts to run once the kernel is loaded
/sys/devices/platform/lf1000-gpio/boot_source # this is how it knows where it booted from (Nor,Nand,USB,UART)
/sys/devices/platform/lf1000-gpio/cart_id # this is how the system differentiates between cart types (Game,MFG cart)
/sys/devices/platform/lf1000-gpio/cpu_freq_in_hz # this is how the system determines what speed the cpu should run at
/sys/devices/platform/lf1000-gpio/panic # I think this tells the system whether the kernel panic'd or not
/sys/devices/platform/lf1000-gpio/power # whether it was a warm or cold boot?
/sys/devices/platform/lf1000-gpio/request # the type boot requested from the kerne;
/sys/devices/platform/lf1000-gpio/shutdown # how the system shutdown the last time