tpm: Support for XFIFO register
Support for the XFIFO register (range) of the TIS 1.3 specification. We support a range of 64 bytes. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
		
							parent
							
								
									feeb755fde
								
							
						
					
					
						commit
						2eae8c7516
					
				@ -51,6 +51,8 @@
 | 
				
			|||||||
#define TPM_TIS_REG_INTF_CAPABILITY       0x14
 | 
					#define TPM_TIS_REG_INTF_CAPABILITY       0x14
 | 
				
			||||||
#define TPM_TIS_REG_STS                   0x18
 | 
					#define TPM_TIS_REG_STS                   0x18
 | 
				
			||||||
#define TPM_TIS_REG_DATA_FIFO             0x24
 | 
					#define TPM_TIS_REG_DATA_FIFO             0x24
 | 
				
			||||||
 | 
					#define TPM_TIS_REG_DATA_XFIFO            0x80
 | 
				
			||||||
 | 
					#define TPM_TIS_REG_DATA_XFIFO_END        0xbc
 | 
				
			||||||
#define TPM_TIS_REG_DID_VID               0xf00
 | 
					#define TPM_TIS_REG_DID_VID               0xf00
 | 
				
			||||||
#define TPM_TIS_REG_RID                   0xf04
 | 
					#define TPM_TIS_REG_RID                   0xf04
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -476,6 +478,7 @@ static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr,
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case TPM_TIS_REG_DATA_FIFO:
 | 
					    case TPM_TIS_REG_DATA_FIFO:
 | 
				
			||||||
 | 
					    case TPM_TIS_REG_DATA_XFIFO ... TPM_TIS_REG_DATA_XFIFO_END:
 | 
				
			||||||
        if (tis->active_locty == locty) {
 | 
					        if (tis->active_locty == locty) {
 | 
				
			||||||
            if (size > 4 - (addr & 0x3)) {
 | 
					            if (size > 4 - (addr & 0x3)) {
 | 
				
			||||||
                /* prevent access beyond FIFO */
 | 
					                /* prevent access beyond FIFO */
 | 
				
			||||||
@ -762,6 +765,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case TPM_TIS_REG_DATA_FIFO:
 | 
					    case TPM_TIS_REG_DATA_FIFO:
 | 
				
			||||||
 | 
					    case TPM_TIS_REG_DATA_XFIFO ... TPM_TIS_REG_DATA_XFIFO_END:
 | 
				
			||||||
        /* data fifo */
 | 
					        /* data fifo */
 | 
				
			||||||
        if (tis->active_locty != locty) {
 | 
					        if (tis->active_locty != locty) {
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user