@@ -94,6 +94,10 @@ extern struct pt_regs fake_swapper_regs;
const char *get_cpu_subtype(struct sh_cpuinfo *c);
extern const struct seq_operations cpuinfo_op;
+#define SH_MODE_PINS_NR 16
+void set_mode_pin(int pin, int on);
+int test_mode_pin(int pin);
+
#ifdef CONFIG_VSYSCALL
int vsyscall_init(void);
#else
@@ -420,6 +420,34 @@ void __init setup_arch(char **cmdline_p)
#endif
}
+/* processor boot mode configuration */
+static DECLARE_BITMAP(mode_pins, SH_MODE_PINS_NR * 2);
+
+void set_mode_pin(int pin, int on)
+{
+ BUG_ON(pin >= SH_MODE_PINS_NR);
+
+ /* mark pin as configured */
+ set_bit(pin + SH_MODE_PINS_NR, mode_pins);
+
+ /* remember pin value */
+ if (on)
+ set_bit(pin, mode_pins);
+ else
+ clear_bit(pin, mode_pins);
+}
+
+int test_mode_pin(int pin)
+{
+ BUG_ON(pin >= SH_MODE_PINS_NR);
+
+ /* warn if not configured */
+ if (!test_bit(pin + SH_MODE_PINS_NR, mode_pins))
+ pr_warning("test_mode_pin(): pin %d not configured\n", pin);
+
+ return test_bit(pin, mode_pins);
+}
+
static const char *cpu_name[] = {
[CPU_SH7201] = "SH7201",
[CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263",