Use the SYS_SW register at 0x10000004 to read the general purpose (user) switch S6. A value of 1 indicates that the switch is on.
0x10000004
Figure 4.5. SYS_SW