#ifndef __ASSEMBLER__ #define __ASSEMBLER__ #endif #include "bmips.h" #include "bchp_common.h" #include "bchp_bsp_glb_control.h" #include "bchp_bsp_cmdbuf.h" /* * The following define needs to be manually turned on/off * depending on what chip the CFE is being built for. * * NON-ZEUS_2_0: * 7231A0/7344A0/7346A0/7420A0/7425A0/7552A0 FullROM * * ZEUS_2_0: * 7231A0/7344A0/7346A0/7420A0/7425A0/7552A0 BSECK * 7231B0/7344B0/7346B0/7420B0/7425B0/7552B0 FullROM */ #define ZEUS_2_0 #if defined(ZEUS_2_0) #define CMD_INBUFFER2 (2 * 384) /* 0x300 */ #else #define CMD_INBUFFER2 (1 * 384) /* 0x180 */ #endif /* ZEUS_2_0 */ #define CMD_OUTBUFFER2 (3 * 384) /* 0x480 */ .text /**************************************************************** Function Name: hide_mips_boot_rom Description: Parameters: None Returns: unsigned char ****************************************************************/ LEAF(hide_mips_boot_rom) .set noreorder /* save ra to t8 so that we can call another function here */ move t8, ra /* check BSP_GLB_NONSECURE_GLB_IRDY */ bal check_for_IRDY2 nop /* command input buffer2 = BCHP_BSP_CMDBUF_DMEMi_ARRAY_BASE+CMD_INBUFFER2 */ /* version */ /* *(volatile unsigned long*) (0xb0327980) = 0x10; */ li t0, PHYS_TO_K1(BCHP_PHYSICAL_OFFSET+BCHP_BSP_CMDBUF_DMEMi_ARRAY_BASE+CMD_INBUFFER2) li t1, 0x10 sw t1, 0(t0) /* seq */ /* *(volatile unsigned long*) (0xb0327984) = 0x22;*/ li t1, 0x22 sw t1, 4(t0) /* cont */ /* *(volatile unsigned long*) (0xb0327988) = 0xABCDEF00; */ li t1, 0xABCDEF00 sw t1, 8(t0) /* command ID to send region verification cmd */ /* *(volatile unsigned long*) (0xb032798C) = 0xF655AA09; */ li t1, 0xF655AA09 sw t1, 12(t0) /* command length in bytes.*/ /* *(volatile unsigned long*) (0xb0327990) = 0x789A0008; */ li t1, 0x789A0008 sw t1, 16(t0) /* region verification op code - 0x9 = hide MIPS boot rom */ /* *(volatile unsigned long*) (0xb0327994) = 9; */ li t1, 0x9 sw t1, 20(t0) /* Reserved */ /* *(volatile unsigned long*) (0xb0327998) = 0; */ li t1, 0x0 sw t1, 24(t0) /* set BSP_GLB_NONSECURE_GLB_ILOAD2 */ /* *(volatile unsigned long*) (VIRTUAL_ADDRESS+BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_ILOAD2) = 0x01; */ li t0, PHYS_TO_K1(BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_ILOAD2) li t1, 0x01 sw t1, 0(t0) /* check BSP_GLB_NONSECURE_GLB_OLOAD2 */ bal check_for_OLOAD2 nop /* BSP_GLB_NONSECURE_GLB_HOST_INTR_STATUS = 0 */ /* *(volatile unsigned long*) (VIRTUAL_ADDRESS+BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_HOST_INTR_STATUS) = 0x00; */ li t0, PHYS_TO_K1(BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_HOST_INTR_STATUS) sw zero, 0(t0) /* BSP_GLB_NONSECURE_GLB_OLOAD2 = 0 */ /* *(volatile unsigned long*) (VIRTUAL_ADDRESS+BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_OLOAD2) = 0x00;*/ li t0, PHYS_TO_K1(BCHP_PHYSICAL_OFFSET+BCHP_BSP_GLB_CONTROL_GLB_OLOAD2) sw zero, 0(t0) /* check status */ /* status = *(volatile unsigned char*) (0xb0327c94); */ li t0, PHYS_TO_K1(BCHP_PHYSICAL_OFFSET+BCHP_BSP_CMDBUF_DMEMi_ARRAY_BASE) li t1, CMD_OUTBUFFER2 addu t0, t0, t1 lw v0, 20(t0) /* Restore ra from t8 */ move ra, t8 .set reorder jr ra nop END(hide_mips_boot_rom)