[keystone-rtos/mcsdk-tools.git] / boot_loader / examples / srio / srioboot_example / src / srioBootExample.c
diff --git a/boot_loader/examples/srio/srioboot_example/src/srioBootExample.c b/boot_loader/examples/srio/srioboot_example/src/srioBootExample.c
index 4bed23ba3dea392e5e04a50bbfee9d6f1f6410fd..e2dcdc3b13557d448228080f4fe7090fbf62b2d7 100644 (file)
#include "platform.h"
#include "srioDdrInit.h"
#include "srioBootCode.h"
+#include "ti/csl/csl_semAux.h"
#define DEVICE_REG32_W(x,y) *(volatile uint32_t *)(x)=(y)
#define DEVICE_REG32_R(x) (*(volatile uint32_t *)(x))
#endif
#ifdef _EVMC6670L_
-#define MAGIC_ADDR 0x87fffc
+#define MAGIC_ADDR 0x8ffffc
#endif
#define BOOT_MAGIC_ADDR(x) (MAGIC_ADDR + (1<<28) + (x<<24))
/* Port error status registers */
#define SRIO_PORT_ERR_STATUS_REG(x) (0x290b158 + x*0x20)
+/* OSAL functions for Platform Library */
+uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
+{
+ return malloc(num_bytes);
+}
+
+void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
+{
+ /* Free up the memory */
+ if (dataPtr)
+ {
+ free(dataPtr);
+ }
+}
+
/* Convert bytes to 32 bits */
uint32_t byteto32bits(uint8_t *pDspCode)
{
return(temp);
}
+void Osal_platformSpiCsEnter(void)
+{
+ /* Get the hardware semaphore.
+ *
+ * Acquire Multi core CPPI synchronization lock
+ */
+ while ((CSL_semAcquireDirect (3)) == 0);
+
+ return;
+}
+
+void Osal_platformSpiCsExit (void)
+{
+ /* Release the hardware semaphore
+ *
+ * Release multi-core lock.
+ */
+ CSL_semReleaseSemaphore (3);
+
+ return;
+}
+
/* Convert to big endian, if the .out to be booted is big endian, this is not required */
void
{
printf("Transfer DDR init code via SRIO successfully\n");
- platform_delay(1000);
+ platform_delay(100000);
/* Push the boot image code to remote DSP DDR and boot core 0 to run Hello World */
if(pushData2Srio(bootCode, rio_id)==0)