#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of_device.h>
static inline u64 omap3_l3_readll(void __iomem *base, u16 reg)
return __raw_readll(base + reg);
static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value)
__raw_writell(value, base + reg);
static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error)
return (error & 0x0f000000) >> L3_ERROR_LOG_CODE;
static inline u32 omap3_l3_decode_addr(u64 error_addr)
return error_addr & 0xffffffff;
static inline unsigned omap3_l3_decode_cmd(u64 error)
return (error & 0x07) >> L3_ERROR_LOG_CMD;
static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error)
return (error & 0xff00) >> L3_ERROR_LOG_INITID;
static inline unsigned omap3_l3_decode_req_info(u64 error)
return (error >> 32) & 0xffff;
static char *omap3_l3_code_string(u8 code)
case OMAP_L3_CODE_NOERROR:
case OMAP_L3_CODE_UNSUP_CMD:
return "Unsupported Command";
case OMAP_L3_CODE_ADDR_HOLE:
case OMAP_L3_CODE_PROTECT_VIOLATION:
return "Protection Violation";
case OMAP_L3_CODE_IN_BAND_ERR:
case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT:
return "Request Timeout Not Accepted";
case OMAP_L3_CODE_REQ_TOUT_NO_RESP:
return "Request Timeout, no response";