]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/tpm/tpm_tis_lpc.c
Update from 2013.01 to 2013.07
[karo-tx-uboot.git] / drivers / tpm / tpm_tis_lpc.c
similarity index 92%
rename from drivers/tpm/generic_lpc_tpm.c
rename to drivers/tpm/tpm_tis_lpc.c
index 6c494eb98a339c5b77859bdbc1ccbd8e6a6a6ff5..eecf18cbf920ebe7721bea11178b5dbf5068b095 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -135,7 +119,7 @@ static u8 tpm_read_byte(const u8 *ptr)
 {
        u8  ret = readb(ptr);
        debug(PREFIX "Read reg 0x%4.4x returns 0x%2.2x\n",
-             (u32)ptr - (u32)lpc_tpm_dev, ret);
+             (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, ret);
        return ret;
 }
 
@@ -143,21 +127,21 @@ static u32 tpm_read_word(const u32 *ptr)
 {
        u32  ret = readl(ptr);
        debug(PREFIX "Read reg 0x%4.4x returns 0x%8.8x\n",
-             (u32)ptr - (u32)lpc_tpm_dev, ret);
+             (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, ret);
        return ret;
 }
 
 static void tpm_write_byte(u8 value, u8 *ptr)
 {
        debug(PREFIX "Write reg 0x%4.4x with 0x%2.2x\n",
-             (u32)ptr - (u32)lpc_tpm_dev, value);
+             (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, value);
        writeb(value, ptr);
 }
 
 static void tpm_write_word(u32 value, u32 *ptr)
 {
        debug(PREFIX "Write reg 0x%4.4x with 0x%8.8x\n",
-             (u32)ptr - (u32)lpc_tpm_dev, value);
+             (u32)(uintptr_t)ptr - (u32)(uintptr_t)lpc_tpm_dev, value);
        writel(value, ptr);
 }
 
@@ -491,5 +475,5 @@ int tis_sendrecv(const u8 *sendbuf, size_t send_size,
                return TPM_DRIVER_ERR;
        }
 
-       return tis_readresponse(recvbuf, recv_len);
+       return tis_readresponse(recvbuf, (u32 *)recv_len);
 }