Use the read-only SYS_SW register at 0x10000004 to read the general purpose (user) switch S6 and the value of the configuration (boot select) switch S8. A value of 1 indicates that the switch is on.
0x10000004
Figure 4.3. SYS_SW