summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 351ca13)
raw | patch | inline | side by side (parent: 351ca13)
author | Angela Stegmaier <angelabaker@ti.com> | |
Wed, 27 Jan 2016 17:45:47 +0000 (11:45 -0600) | ||
committer | Buddy Liong <a0270631@ti.com> | |
Fri, 17 Jun 2016 15:15:45 +0000 (10:15 -0500) |
Remove the hard-codings of IVAHD addresses and instead
use the IPC3 Resource_physToVirt() call to get the correct
virtual address. In this way, changes to the resource
table don't require changes in the code.
Change-Id: I874afeb59fb66f8dba1d56e252c2b1ad217f20cb
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
use the IPC3 Resource_physToVirt() call to get the correct
virtual address. In this way, changes to the resource
table don't require changes in the code.
Change-Id: I874afeb59fb66f8dba1d56e252c2b1ad217f20cb
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
src/ti/framework/dce/ivahd.c | patch | blob | history | |
src/ti/utils/profile.c | patch | blob | history |
index 3fa87f25310a48a117fb5ec0592bc9fbcb5f4a58..399cf949c5ba73f1621a83ddfb8bc7fd0bdbc663 100644 (file)
#include <ti/sdo/fc/ires/hdvicp/hdvicp2.h>
#include <ti/sdo/fc/ires/hdvicp/hdvicp2.h>
+#include <ti/ipc/remoteproc/Resource.h>
+
//#define MEMORYSTATS_DEBUG
static uint32_t ivahd_base = 0;
+static uint32_t ivahd_cm_base = 0;
+static uint32_t ivahd_config_base = 0;
static uint32_t get_ivahd_base(void)
{
return (ivahd_base);
}
+static uint32_t get_ivahd_cm_base(void)
+{
+ if( !ivahd_cm_base ) {
+ ERROR("Chipset ID not set!");
+
+ while( TRUE ) {
+ asm (" wfi");
+ }
+ }
+ return (ivahd_cm_base);
+}
+
+static uint32_t get_ivahd_config_base(void)
+{
+ if( !ivahd_config_base ) {
+ ERROR("Chipset ID not set!");
+
+ while( TRUE ) {
+ asm (" wfi");
+ }
+ }
+ return (ivahd_config_base);
+}
+
#define IVAHD_REG(off) (*(volatile unsigned int *)(get_ivahd_base() + (off)))
#define PM_IVAHD_PWRSTCTRL IVAHD_REG(0x00)
#define RM_IVAHD_RSTCTRL IVAHD_REG(0x10)
#define RM_IVAHD_RSTST IVAHD_REG(0x14)
+#define IVAHD_CM_REG(off) (*(volatile unsigned int *)(get_ivahd_cm_base() + (off)))
+
+#if ((defined OMAP5430_ES10) || (defined VAYU_ES10))
+ #define CM_IVAHD_CLKSTCTRL IVAHD_CM_REG(0x8F00)
+ #define CM_IVAHD_CLKCTRL IVAHD_CM_REG(0x8F20)
+ #define CM_IVAHD_SL2_CLKCTRL IVAHD_CM_REG(0x8F28)
#if (defined OMAP5430_ES10)
- #define CM_IVAHD_CLKSTCTRL (*(volatile unsigned int *)0xAA008F00)
- #define CM_IVAHD_CLKCTRL (*(volatile unsigned int *)0xAA008F20)
- #define CM_IVAHD_SL2_CLKCTRL (*(volatile unsigned int *)0xAA008F28)
- #define CM_DIV_DPLL_IVA (*(volatile unsigned int *)0xAA0041BC)
- #define IVAHD_CONFIG_REG_BASE (0xBA000000)
+ #define CM_DIV_DPLL_IVA IVAHD_CM_REG(0x41BC)
#elif (defined VAYU_ES10)
- #define CM_IVAHD_CLKSTCTRL (*(volatile unsigned int *)0x6A008F00)
- #define CM_IVAHD_CLKCTRL (*(volatile unsigned int *)0x6A008F20)
- #define CM_IVAHD_SL2_CLKCTRL (*(volatile unsigned int *)0x6A008F28)
- #define CM_DIV_DPLL_IVA (*(volatile unsigned int *)0x6A0051B0)
- #define IVAHD_CONFIG_REG_BASE (0x7A000000)
+ #define CM_DIV_DPLL_IVA IVAHD_CM_REG(0x51B0)
+#else
+ #error Undefined Board Type
+#endif
#elif (defined OMAP5432_ES20)
- #define CM_IVAHD_CLKSTCTRL (*(volatile unsigned int *)0xAA009200)
- #define CM_IVAHD_CLKCTRL (*(volatile unsigned int *)0xAA009220)
- #define CM_IVAHD_SL2_CLKCTRL (*(volatile unsigned int *)0xAA009228)
- #define CM_DIV_DPLL_IVA (*(volatile unsigned int *)0xAA0041BC)
- #define IVAHD_CONFIG_REG_BASE (0xBA000000)
+ #define CM_IVAHD_CLKSTCTRL IVAHD_CM_REG(0x9200)
+ #define CM_IVAHD_CLKCTRL IVAHD_CM_REG(0x9220)
+ #define CM_IVAHD_SL2_CLKCTRL IVAHD_CM_REG(0x9228)
+ #define CM_DIV_DPLL_IVA IVAHD_CM_REG(0x41BC)
+#else
+ #error Undefined Board Type
#endif //OMAP5_ES10
+#define IVAHD_CONFIG_REG_BASE (get_ivahd_config_base())
#define ICONT1_ITCM_BASE (IVAHD_CONFIG_REG_BASE + 0x08000)
#define ICONT2_ITCM_BASE (IVAHD_CONFIG_REG_BASE + 0x18000)
void ivahd_init(uint32_t chipset_id)
{
IRES_Status ret;
+ uint32_t ivahd_base_pa = 0;
+ uint32_t ivahd_cm_base_pa = 0;
+ uint32_t ivahd_config_base_pa = 0;
IRESMAN_Params rman_params =
{
.size = sizeof(IRESMAN_Params),
switch( chipset_id ) {
case 0x4430 :
- ivahd_base = 0xAA306F00;
+ ivahd_base_pa = 0x4A306F00;
break;
case 0x4460 :
case 0x4470 :
- ivahd_base = 0xAA306F00;
+ ivahd_base_pa = 0x4A306F00;
break;
case 0x5430 :
- ivahd_base = 0xAAE06F00;
+ ivahd_base_pa = 0x4AE06F00;
+ ivahd_cm_base_pa = 0x4A000000;
+ ivahd_config_base_pa = 0x5A000000;
break;
case 0x5432 :
- ivahd_base = 0xAAE07200;
+ ivahd_base_pa = 0x4AE07200;
+ ivahd_cm_base_pa = 0x4A000000;
+ ivahd_config_base_pa = 0x5A000000;
break;
case 0x5436 :
- ivahd_base = 0x6AE06F00;
+ ivahd_base_pa = 0x4AE06F00;
+ ivahd_cm_base_pa = 0x4A000000;
+ ivahd_config_base_pa = 0x5A000000;
break;
default :
ERROR("Invalid chipset-id: %x", chipset_id);
break;
}
+ if (ivahd_base_pa) {
+ if (Resource_physToVirt(ivahd_base_pa, &ivahd_base)) {
+ ERROR("Unable to get ivahd_base\n");
+ return;
+ }
+ }
+
DEBUG("ivahd_base=%08x", ivahd_base);
+ if (ivahd_cm_base_pa) {
+ if (Resource_physToVirt(ivahd_cm_base_pa, &ivahd_cm_base)) {
+ ERROR("Unable to get ivahd_cm_base\n");
+ return;
+ }
+ }
+
+ DEBUG("ivahd_cm_base=%08x", ivahd_cm_base);
+
+ if (ivahd_config_base_pa) {
+ if (Resource_physToVirt(ivahd_config_base_pa, &ivahd_config_base)) {
+ ERROR("Unable to get ivahd_config_base\n");
+ return;
+ }
+ }
+
/* bit of a hack.. not sure if there is a better way for this: */
HDVICP2_PARAMS.resetControlAddress[0] = ivahd_base + 0x10;
diff --git a/src/ti/utils/profile.c b/src/ti/utils/profile.c
index 02b680117b11efbd91a768d6b88a02cdda11e2b7..77e7cd3ba65423d4858ac7f3d046e5ac59c6c704 100644 (file)
--- a/src/ti/utils/profile.c
+++ b/src/ti/utils/profile.c
* This function prevents sleep mode to the L4 WKUPAON_CM
* register, to avoid large stalls when reading the 32k timer
***************************************************************/
+/* Commenting set_WKUPAON() to make sure it isn't used. Need to
+ * investigate if this function is still needed. This code is
+ * attempting to directly access a physical address when only
+ * virtual addresses should be accessed. This function is not
+ * currently called. If we don't need this function, can we
+ * remove it?
+ */
+#if 0
extern void *MEMUTILS_getPhysicalAddr(Ptr vaddr);
void set_WKUPAON(int force_restore)
{
}
*(Uint32 *)0xAAE07800 = reg;
}
+#endif
/***************************************************************
* PSI_TracePrintf