1 /* 2 * linux/sunxi-sid.h 3 * 4 * Copyright(c) 2014-2016 Allwinnertech Co., Ltd. 5 * http://www.allwinnertech.com 6 * 7 * Author: sunny <sunny@allwinnertech.com> 8 * 9 * allwinner sunxi soc chip version and chip id manager. 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 */ 16 17 #ifndef __SUNXI_MACH_SUNXI_CHIP_H 18 #define __SUNXI_MACH_SUNXI_CHIP_H 19 20 #include <linux/types.h> 21 22 23 /* The key info in Efuse */ 24 25 #define EFUSE_CHIPID_NAME "chipid" 26 #define EFUSE_BROM_CONF_NAME "brom_conf" 27 #define EFUSE_BROM_TRY_NAME "brom_try" 28 #define EFUSE_THM_SENSOR_NAME "thermal_sensor" 29 #define EFUSE_FT_ZONE_NAME "ft_zone" 30 #define EFUSE_TV_OUT_NAME "tvout" 31 #define EFUSE_TVE_NAME "tve" 32 #define EFUSE_OEM_NAME "oem" 33 #define EFUSE_ANTI_BLUSH_NAME "anti_blushing" 34 35 #define EFUSE_PSENSOR_NAME "psensor" 36 #define EFUSE_DDR_CFG_NAME "ddr_cfg" 37 #define EFUSE_LDOA_NAME "ldoa" 38 #define EFUSE_LDOB_NAME "ldob" 39 #define EFUSE_AUDIO_BIAS_NAME "audio_bias" 40 #define EFUSE_GAMMA_NAME "gamma" 41 #define EFUSE_WR_PROTECT_NAME "write_protect" 42 #define EFUSE_RD_PROTECT_NAME "read_protect" 43 #define EFUSE_IN_NAME "in" 44 #define EFUSE_ID_NAME "id" 45 #define EFUSE_ROTPK_NAME "rotpk" 46 #define EFUSE_SSK_NAME "ssk" 47 #define EFUSE_RSSK_NAME "rssk" 48 #define EFUSE_HDCP_HASH_NAME "hdcp_hash" 49 #define EFUSE_HDCP_PKF_NAME "hdcp_pkf" 50 #define EFUSE_HDCP_DUK_NAME "hdcp_duk" 51 #define EFUSE_EK_HASH_NAME "ek_hash" 52 #define EFUSE_SN_NAME "sn" 53 #define EFUSE_NV1_NAME "nv1" 54 #define EFUSE_NV2_NAME "nv2" 55 #define EFUSE_BACKUP_KEY_NAME "backup_key" 56 #define EFUSE_BACKUP_KEY2_NAME "backup_key2" 57 #define EFUSE_TCON_PARM_NAME "tcon_parm" 58 #define EFUSE_RSAKEY_HASH_NAME "rsakey_hash" 59 #define EFUSE_RENEW_NAME "renewability" 60 #define EFUSE_OPT_ID_NAME "operator_id" 61 #define EFUSE_LIFE_CYCLE_NAME "life_cycle" 62 #define EFUSE_JTAG_SECU_NAME "jtag_security" 63 #define EFUSE_JTAG_ATTR_NAME "jtag_attr" 64 #define EFUSE_CHIP_CONF_NAME "chip_config" 65 #define EFUSE_RESERVED_NAME "reserved" 66 #define EFUSE_RESERVED2_NAME "reserved2" 67 68 #define SUNXI_KEY_NAME_LEN 32 69 70 #define SID_PRCTL 0x40 71 #define SID_RDKEY 0x60 72 #define SID_OP_LOCK 0xAC 73 74 #define SRAM_CTRL_BASE "allwinner,sram_ctrl" 75 #define EFUSE_SID_BASE "allwinner,sunxi-sid" 76 77 #define sunxi_efuse_read(key_name, read_buf) \ 78 sunxi_efuse_readn(key_name, read_buf, 1024) 79 80 /* The interface functions */ 81 unsigned int sunxi_get_soc_ver(void); 82 int sunxi_get_soc_chipid(unsigned char *chipid); 83 int sunxi_get_soc_chipid_str(char *chipid); 84 int sunxi_get_soc_ft_zone_str(char *serial); 85 int sunxi_get_soc_rotpk_status_str(char *status); 86 int sunxi_get_pmu_chipid(unsigned char *chipid); 87 int sunxi_get_serial(unsigned char *serial); 88 unsigned int sunxi_get_soc_bin(void); 89 int sunxi_soc_is_secure(void); 90 s32 sunxi_get_platform(s8 *buf, s32 size); 91 s32 sunxi_efuse_readn(s8 *key_name, void *buf, u32 n); 92 int sunxi_get_module_param_from_sid(u32 *dst, u32 offset, u32 len); 93 #endif /* __SUNXI_MACH_SUNXI_CHIP_H */ 94