5
#ifndef __BFIN_PERIPHERAL_OTP__
6
#define __BFIN_PERIPHERAL_OTP__
12
static uint32_t (* const bfrom_OtpCommand)(uint32_t command, uint32_t value) = (void *)_BOOTROM_OTP_COMMAND;
13
static uint32_t (* const bfrom_OtpRead)(uint32_t page, uint32_t flags, uint64_t *page_content) = (void *)_BOOTROM_OTP_READ;
14
static uint32_t (* const bfrom_OtpWrite)(uint32_t page, uint32_t flags, uint64_t *page_content) = (void *)_BOOTROM_OTP_WRITE;
18
/* otp_command(): defines for "command" */
19
#define OTP_INIT 0x00000001
20
#define OTP_CLOSE 0x00000002
22
/* otp_{read,write}(): defines for "flags" */
23
#define OTP_LOWER_HALF 0x00000000 /* select upper/lower 64-bit half (bit 0) */
24
#define OTP_UPPER_HALF 0x00000001
25
#define OTP_NO_ECC 0x00000010 /* do not use ECC */
26
#define OTP_LOCK 0x00000020 /* sets page protection bit for page */
27
#define OTP_CHECK_FOR_PREV_WRITE 0x00000080
29
/* Return values for all functions */
30
#define OTP_SUCCESS 0x00000000
31
#define OTP_MASTER_ERROR 0x001
32
#define OTP_WRITE_ERROR 0x003
33
#define OTP_READ_ERROR 0x005
34
#define OTP_ACC_VIO_ERROR 0x009
35
#define OTP_DATA_MULT_ERROR 0x011
36
#define OTP_ECC_MULT_ERROR 0x021
37
#define OTP_PREV_WR_ERROR 0x041
38
#define OTP_DATA_SB_WARN 0x100
39
#define OTP_ECC_SB_WARN 0x200
41
/* Predefined otp pages: Factory Programmed Settings */
55
/* Predefined otp pages: Customer Programmed Settings */
65
/* Predefined otp pages: Pre-Boot Settings */