platform: msm_shared: Do not write to bam control registers
Do not configure BAM in non-secure world, BAM is enabled by TZ and the
control registers are xpu protected and cannot be accessed in NS world.
Change-Id: If1e1a36dfd1b8028c72670cd312d1eab7a6857bd
diff --git a/platform/msm_shared/bam.c b/platform/msm_shared/bam.c
index f123b87..723ce00 100644
--- a/platform/msm_shared/bam.c
+++ b/platform/msm_shared/bam.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012,2015 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -39,18 +39,6 @@
#define HLOS_EE_INDEX 0
-/* Reset BAM registers and pipes */
-static void bam_reset(struct bam_instance *bam)
-{
- /* Initiate SW reset */
- writel(BAM_SW_RST_BIT_MASK, BAM_CTRL_REG(bam->base));
-
- /* No delay required */
-
- /* Disable SW reset */
- writel(~BAM_SW_RST_BIT_MASK, BAM_CTRL_REG(bam->base));
-}
-
/* Resets pipe registers and state machines */
void bam_pipe_reset(struct bam_instance *bam,
uint8_t pipe_num)
@@ -151,10 +139,6 @@
/* Reset and initialize the bam module */
void bam_init(struct bam_instance *bam)
{
- uint32_t val = 0;
-
-// bam_reset(bam);
-
/* Check for only one pipe's direction.
* The other is assumed to be the opposite system
* transaction.
@@ -165,13 +149,6 @@
/* Program the threshold count */
writel(bam->threshold, BAM_DESC_CNT_TRSHLD_REG(bam->base));
}
-
- /* Program config register for H/W bug fixes */
- val = 0xffffffff & ~(1 << 11);
- writel(val, BAM_CNFG_BITS(bam->base));
-
- /* Enable the BAM */
- writel(BAM_ENABLE_BIT_MASK, BAM_CTRL_REG(bam->base));
}
/* Funtion to setup a simple fifo structure.
diff --git a/platform/msm_shared/include/bam.h b/platform/msm_shared/include/bam.h
index 6e4e7f4..bfeb34b 100644
--- a/platform/msm_shared/include/bam.h
+++ b/platform/msm_shared/include/bam.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012,2015 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -71,10 +71,6 @@
#define BAM_DATA_READ 0
#define BAM_DATA_WRITE 1
-#define BAM_CTRL_REG(x) (0x0000 + (x))
-#define BAM_SW_RST_BIT_MASK 1
-#define BAM_ENABLE_BIT_MASK (1 << 1)
-
#define BAM_DESC_CNT_TRSHLD_REG(x) (0x0008 + (x))
#define COUNT_TRESHOLD_MASK 0xFF
#define BAM_IRQ_MASK (1 << 31)
@@ -94,8 +90,6 @@
#define BAM_RESET_BLK_MASK (1 << 7)
#define BAM_LOCK_EE_CTRL_MASK (1 << 13)
-#define BAM_CNFG_BITS(x) (0x0000007C + (x))
-
#define P_SYS_MODE_MASK (1 << 5)
/* 1: Producer mode 0: Consumer mode */
#define P_DIRECTION_SHIFT 3