ARM: OMAP2+: Export SoC information to userspace
[pandora-kernel.git] / arch / arm / mach-omap2 / omap_l3_smx.c
index fa07edf..df18e02 100644 (file)
@@ -1,26 +1,26 @@
- /*
 * OMAP3XXX L3 Interconnect Driver
 *
 * Copyright (C) 2011 Texas Corporation
 *    Felipe Balbi <balbi@ti.com>
 *    Santosh Shilimkar <santosh.shilimkar@ti.com>
 *    Sricharan <r.sricharan@ti.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */
+/*
+ * OMAP3XXX L3 Interconnect Driver
+ *
+ * Copyright (C) 2011 Texas Corporation
    Felipe Balbi <balbi@ti.com>
    Santosh Shilimkar <santosh.shilimkar@ti.com>
    Sricharan <r.sricharan@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -135,7 +135,7 @@ static char *omap3_l3_initiator_string(u8 initid)
        }
 }
 
-/**
+/*
  * omap3_l3_block_irq - handles a register block's irq
  * @l3: struct omap3_l3 *
  * @base: register block base address
@@ -150,30 +150,29 @@ static char *omap3_l3_initiator_string(u8 initid)
 static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
                                        u64 error, int error_addr)
 {
-       u8                      code = omap3_l3_decode_error_code(error);
-       u8                      initid = omap3_l3_decode_initid(error);
-       u8                      multi = error & L3_ERROR_LOG_MULTI;
-       u32                     address = omap3_l3_decode_addr(error_addr);
+       u8 code = omap3_l3_decode_error_code(error);
+       u8 initid = omap3_l3_decode_initid(error);
+       u8 multi = error & L3_ERROR_LOG_MULTI;
+       u32 address = omap3_l3_decode_addr(error_addr);
 
        WARN(true, "%s seen by %s %s at address %x\n",
-                                omap3_l3_code_string(code),
-                         omap3_l3_initiator_string(initid),
-                            multi ? "Multiple Errors" : "",
-                                                  address);
+                       omap3_l3_code_string(code),
+                       omap3_l3_initiator_string(initid),
+                       multi ? "Multiple Errors" : "", address);
 
        return IRQ_HANDLED;
 }
 
 static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
 {
-       struct omap3_l3         *l3 = _l3;
-       u64                     status, clear;
-       u64                     error;
-       u64                     error_addr;
-       u64                     err_source = 0;
-       void                    __iomem *base;
-       int                     int_type;
-       irqreturn_t             ret = IRQ_NONE;
+       struct omap3_l3 *l3 = _l3;
+       u64 status, clear;
+       u64 error;
+       u64 error_addr;
+       u64 err_source = 0;
+       void __iomem *base;
+       int int_type;
+       irqreturn_t ret = IRQ_NONE;
 
        int_type = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;
        if (!int_type) {
@@ -184,7 +183,8 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
                 * of such errors and handle the others. timeout error
                 * is severe and not expected to occur.
                 */
-               BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
+               WARN(status & L3_STATUS_0_TIMEOUT_MASK,
+                       "L3_APPLICATION_ERROR, status %llx", status);
        } else {
                status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
                /* No timeout error for debug sources */
@@ -197,7 +197,6 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
        error = omap3_l3_readll(base, L3_ERROR_LOG);
        if (error) {
                error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);
-
                ret |= omap3_l3_block_irq(l3, error, error_addr);
        }
 
@@ -214,9 +213,9 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
 
 static int __init omap3_l3_probe(struct platform_device *pdev)
 {
-       struct omap3_l3         *l3;
-       struct resource         *res;
-       int                     ret;
+       struct omap3_l3 *l3;
+       struct resource *res;
+       int ret;
 
        l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
        if (!l3)