#include <hw_defs.h>
#include <hw_mmu.h>
#include <linux/types.h>
+#include <linux/err.h>
#define MMU_BASE_VAL_MASK 0xFC00
#define MMU_PAGE_MAX 3
* RETURNS:
*
* Type : hw_status
- * Description : RET_OK -- No errors occured
+ * Description : 0 -- No errors occured
* RET_BAD_NULL_PARAM -- A Pointer
* Paramater was set to NULL
*
* RETURNS:
*
* Type : hw_status
- * Description : RET_OK -- No errors occured
+ * Description : 0 -- No errors occured
* RET_BAD_NULL_PARAM -- A Pointer Paramater
* was set to NULL
* RET_PARAM_OUT_OF_RANGE -- Input Parameter out
* RETURNS:
*
* Type : hw_status
- * Description : RET_OK -- No errors occured
+ * Description : 0 -- No errors occured
* RET_BAD_NULL_PARAM -- A Pointer Paramater
* was set to NULL
* RET_PARAM_OUT_OF_RANGE -- Input Parameter
hw_status hw_mmu_enable(const void __iomem *base_address)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_CNTLMMU_ENABLE_WRITE32(base_address, HW_SET);
hw_status hw_mmu_disable(const void __iomem *base_address)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_CNTLMMU_ENABLE_WRITE32(base_address, HW_CLEAR);
hw_status hw_mmu_num_locked_set(const void __iomem *base_address,
u32 num_locked_entries)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_LOCK_BASE_VALUE_WRITE32(base_address, num_locked_entries);
hw_status hw_mmu_victim_num_set(const void __iomem *base_address,
u32 victim_entry_num)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_LOCK_CURRENT_VICTIM_WRITE32(base_address, victim_entry_num);
hw_status hw_mmu_event_ack(const void __iomem *base_address, u32 irq_mask)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_IRQSTATUS_WRITE_REGISTER32(base_address, irq_mask);
hw_status hw_mmu_event_disable(const void __iomem *base_address, u32 irq_mask)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 irq_reg;
irq_reg = MMUMMU_IRQENABLE_READ_REGISTER32(base_address);
hw_status hw_mmu_event_enable(const void __iomem *base_address, u32 irq_mask)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 irq_reg;
irq_reg = MMUMMU_IRQENABLE_READ_REGISTER32(base_address);
hw_status hw_mmu_event_status(const void __iomem *base_address, u32 *irq_mask)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
*irq_mask = MMUMMU_IRQSTATUS_READ_REGISTER32(base_address);
hw_status hw_mmu_fault_addr_read(const void __iomem *base_address, u32 *addr)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
/*Check the input Parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
hw_status hw_mmu_ttb_set(const void __iomem *base_address, u32 ttb_phys_addr)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 load_ttb;
/*Check the input Parameters */
hw_status hw_mmu_twl_enable(const void __iomem *base_address)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_CNTLTWL_ENABLE_WRITE32(base_address, HW_SET);
hw_status hw_mmu_twl_disable(const void __iomem *base_address)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
MMUMMU_CNTLTWL_ENABLE_WRITE32(base_address, HW_CLEAR);
hw_status hw_mmu_tlb_flush(const void __iomem *base_address, u32 virtual_addr,
u32 page_sz)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 virtual_addr_tag;
enum hw_mmu_page_size_t pg_size_bits;
break;
default:
- return RET_FAIL;
+ return -EINVAL;
}
/* Generate the 20-bit tag from virtual address */
struct hw_mmu_map_attrs_t *map_attrs,
s8 preserved_bit, s8 valid_bit)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 lock_reg;
u32 virtual_addr_tag;
enum hw_mmu_page_size_t mmu_pg_size;
break;
default:
- return RET_FAIL;
+ return -EINVAL;
}
lock_reg = MMUMMU_LOCK_READ_REGISTER32(base_address);
u32 virtual_addr,
u32 page_sz, struct hw_mmu_map_attrs_t *map_attrs)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 pte_addr, pte_val;
s32 num_entries = 1;
break;
default:
- return RET_FAIL;
+ return -EINVAL;
}
while (--num_entries >= 0)
hw_status hw_mmu_pte_clear(const u32 pg_tbl_va, u32 virtual_addr, u32 page_size)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 pte_addr;
s32 num_entries = 1;
break;
default:
- return RET_FAIL;
+ return -EINVAL;
}
while (--num_entries >= 0)
/* mmu_flush_entry */
static hw_status mmu_flush_entry(const void __iomem *base_address)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 flush_entry_data = 0x1;
/*Check the input Parameters */
const u32 valid_bit,
const u32 virtual_addr_tag)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 mmu_cam_reg;
/*Check the input Parameters */
enum hw_element_size_t element_size,
enum hw_mmu_mixed_size_t mixed_size)
{
- hw_status status = RET_OK;
+ hw_status status = 0;
u32 mmu_ram_reg;
/*Check the input Parameters */