/*************************************************************************** * * Copyright 2015-2019 BES. * All rights reserved. All unpublished rights reserved. * * No part of this work may be used or reproduced in any form or by any * means, or stored in a database or retrieval system, without prior written * permission of BES. * * Use of this work is governed by a license granted by BES. * This work contains confidential and proprietary information of * BES. which is protected by copyright, trade secret, * trademark and other intellectual property rights. * ****************************************************************************/ #ifndef __HAL_PSRAMIP_V1_H__ #define __HAL_PSRAMIP_V1_H__ #ifdef __cplusplus extern "C" { #endif #include "plat_types.h" #include "reg_psramip_v1.h" #define PSRIP_KEY (0x55000000) #define psramip_read8(reg_base,a) \ (*(volatile unsigned char*)((reg_base)+(a))) #define psramip_read32(reg_base,a) \ (*(volatile unsigned int *)((reg_base)+(a))) #define psramip_write32(v,reg_base,a) \ ((*(volatile unsigned int *)((reg_base)+(a))) = v) #define PSRAM_STAT_BUSY (0x01) #define PSRAM_STAT_TXFIFO_EMPTY (0x02) #define PSRAM_STAT_TXFIFO_FULL (0x04) #define PSRAM_STAT_RXFIFO_EMPTY (0x08) #define PSRAM_STAT_RXFIFO_COUNT (0x1f << 4) /* ip ops */ #if 1 inline static void psramip_w_cmd_addr(uint32_t reg_base, uint32_t cmd, uint32_t addr) { psramip_write32(cmd<