2 * bootinfo.c: This code provides boot information via /proc/bootinfo.
3 * The information currently includes:
5 * - the hardware revision
6 * All new user-space consumers of the powerup reason should use
7 * the /proc/bootinfo interface; all kernel-space consumers of the
8 * powerup reason should use the stingray_powerup_reason interface.
10 * Copyright (C) 2009 Motorola, Inc.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 * ---------- -------- -----------
30 * 30/06/2009 Motorola Initialize version
31 * 25/10/2010 Motorola Modified for stingray
32 * 30/10/2010 Motorola Converted to seq_file interface
35 #include <linux/kernel.h>
36 #include <linux/init.h>
37 #include <linux/seq_file.h>
38 #include <linux/proc_fs.h>
39 #include <asm/setup.h>
40 #include "board-stingray.h"
42 static int bootinfo_show(struct seq_file *m, void *v)
44 seq_printf(m, "POWERUPREASON : 0x%08x\n",
45 stingray_powerup_reason());
47 seq_printf(m, "BOARDREVISION : 0x%08x\n",
53 static int bootinfo_open(struct inode *inode, struct file *file)
55 return single_open(file, bootinfo_show, NULL);
58 static const struct file_operations bootinfo_operations = {
59 .open = bootinfo_open,
62 .release = single_release,
65 int __init bootinfo_init(void)
67 struct proc_dir_entry *pe;
69 pe = proc_create("bootinfo", S_IRUGO, NULL, &bootinfo_operations);
76 device_initcall(bootinfo_init);