diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2011-03-01 13:01:49 -0500 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2011-03-10 13:30:14 -0500 |
commit | 5c7707554858eca8903706b6df7cba5c0f802244 (patch) | |
tree | 6ebb5ef933b1cf4dbca374cf2a03e249383cd41e /arch/tile | |
parent | d91c641233ae09fcccec75313b7f55992668bf8d (diff) |
drivers/edac: provide support for tile architecture
Add tile support for the EDAC driver, which provides unified system
error (memory, PCI, etc.) reporting. For now, the TILEPro port
reports memory correctable error (CE) only.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/include/asm/edac.h | 29 | ||||
-rw-r--r-- | arch/tile/include/hv/drv_mshim_intf.h | 50 | ||||
-rw-r--r-- | arch/tile/include/hv/hypervisor.h | 41 |
3 files changed, 119 insertions, 1 deletions
diff --git a/arch/tile/include/asm/edac.h b/arch/tile/include/asm/edac.h new file mode 100644 index 000000000000..87fc83eeaffd --- /dev/null +++ b/arch/tile/include/asm/edac.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef _ASM_TILE_EDAC_H | ||
16 | #define _ASM_TILE_EDAC_H | ||
17 | |||
18 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ | ||
19 | |||
20 | static inline void atomic_scrub(void *va, u32 size) | ||
21 | { | ||
22 | /* | ||
23 | * These is nothing to be done here because CE is | ||
24 | * corrected by the mshim. | ||
25 | */ | ||
26 | return; | ||
27 | } | ||
28 | |||
29 | #endif /* _ASM_TILE_EDAC_H */ | ||
diff --git a/arch/tile/include/hv/drv_mshim_intf.h b/arch/tile/include/hv/drv_mshim_intf.h new file mode 100644 index 000000000000..c6ef3bdc55cf --- /dev/null +++ b/arch/tile/include/hv/drv_mshim_intf.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | /** | ||
16 | * @file drv_mshim_intf.h | ||
17 | * Interface definitions for the Linux EDAC memory controller driver. | ||
18 | */ | ||
19 | |||
20 | #ifndef _SYS_HV_INCLUDE_DRV_MSHIM_INTF_H | ||
21 | #define _SYS_HV_INCLUDE_DRV_MSHIM_INTF_H | ||
22 | |||
23 | /** Number of memory controllers in the public API. */ | ||
24 | #define TILE_MAX_MSHIMS 4 | ||
25 | |||
26 | /** Memory info under each memory controller. */ | ||
27 | struct mshim_mem_info | ||
28 | { | ||
29 | uint64_t mem_size; /**< Total memory size in bytes. */ | ||
30 | uint8_t mem_type; /**< Memory type, DDR2 or DDR3. */ | ||
31 | uint8_t mem_ecc; /**< Memory supports ECC. */ | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * DIMM error structure. | ||
36 | * For now, only correctable errors are counted and the mshim doesn't record | ||
37 | * the error PA. HV takes panic upon uncorrectable errors. | ||
38 | */ | ||
39 | struct mshim_mem_error | ||
40 | { | ||
41 | uint32_t sbe_count; /**< Number of single-bit errors. */ | ||
42 | }; | ||
43 | |||
44 | /** Read this offset to get the memory info per mshim. */ | ||
45 | #define MSHIM_MEM_INFO_OFF 0x100 | ||
46 | |||
47 | /** Read this offset to check DIMM error. */ | ||
48 | #define MSHIM_MEM_ERROR_OFF 0x200 | ||
49 | |||
50 | #endif /* _SYS_HV_INCLUDE_DRV_MSHIM_INTF_H */ | ||
diff --git a/arch/tile/include/hv/hypervisor.h b/arch/tile/include/hv/hypervisor.h index 103986b0c10a..1b8bf03d62a0 100644 --- a/arch/tile/include/hv/hypervisor.h +++ b/arch/tile/include/hv/hypervisor.h | |||
@@ -338,9 +338,10 @@ typedef int HV_Errno; | |||
338 | #define HV_ENOTREADY -812 /**< Device not ready */ | 338 | #define HV_ENOTREADY -812 /**< Device not ready */ |
339 | #define HV_EIO -813 /**< I/O error */ | 339 | #define HV_EIO -813 /**< I/O error */ |
340 | #define HV_ENOMEM -814 /**< Out of memory */ | 340 | #define HV_ENOMEM -814 /**< Out of memory */ |
341 | #define HV_EAGAIN -815 /**< Try again */ | ||
341 | 342 | ||
342 | #define HV_ERR_MAX -801 /**< Largest HV error code */ | 343 | #define HV_ERR_MAX -801 /**< Largest HV error code */ |
343 | #define HV_ERR_MIN -814 /**< Smallest HV error code */ | 344 | #define HV_ERR_MIN -815 /**< Smallest HV error code */ |
344 | 345 | ||
345 | #ifndef __ASSEMBLER__ | 346 | #ifndef __ASSEMBLER__ |
346 | 347 | ||
@@ -867,6 +868,43 @@ typedef struct | |||
867 | */ | 868 | */ |
868 | HV_PhysAddrRange hv_inquire_physical(int idx); | 869 | HV_PhysAddrRange hv_inquire_physical(int idx); |
869 | 870 | ||
871 | /** Possible DIMM types. */ | ||
872 | typedef enum | ||
873 | { | ||
874 | NO_DIMM = 0, /**< No DIMM */ | ||
875 | DDR2 = 1, /**< DDR2 */ | ||
876 | DDR3 = 2 /**< DDR3 */ | ||
877 | } HV_DIMM_Type; | ||
878 | |||
879 | #ifdef __tilegx__ | ||
880 | |||
881 | /** Log2 of minimum DIMM bytes supported by the memory controller. */ | ||
882 | #define HV_MSH_MIN_DIMM_SIZE_SHIFT 29 | ||
883 | |||
884 | /** Max number of DIMMs contained by one memory controller. */ | ||
885 | #define HV_MSH_MAX_DIMMS 8 | ||
886 | |||
887 | #else | ||
888 | |||
889 | /** Log2 of minimum DIMM bytes supported by the memory controller. */ | ||
890 | #define HV_MSH_MIN_DIMM_SIZE_SHIFT 26 | ||
891 | |||
892 | /** Max number of DIMMs contained by one memory controller. */ | ||
893 | #define HV_MSH_MAX_DIMMS 2 | ||
894 | |||
895 | #endif | ||
896 | |||
897 | /** Number of bits to right-shift to get the DIMM type. */ | ||
898 | #define HV_DIMM_TYPE_SHIFT 0 | ||
899 | |||
900 | /** Bits to mask to get the DIMM type. */ | ||
901 | #define HV_DIMM_TYPE_MASK 0xf | ||
902 | |||
903 | /** Number of bits to right-shift to get the DIMM size. */ | ||
904 | #define HV_DIMM_SIZE_SHIFT 4 | ||
905 | |||
906 | /** Bits to mask to get the DIMM size. */ | ||
907 | #define HV_DIMM_SIZE_MASK 0xf | ||
870 | 908 | ||
871 | /** Memory controller information. */ | 909 | /** Memory controller information. */ |
872 | typedef struct | 910 | typedef struct |
@@ -1043,6 +1081,7 @@ int hv_console_write(HV_VirtAddr bytes, int len); | |||
1043 | * downcall: | 1081 | * downcall: |
1044 | * | 1082 | * |
1045 | * INT_MESSAGE_RCV_DWNCL (hypervisor message available) | 1083 | * INT_MESSAGE_RCV_DWNCL (hypervisor message available) |
1084 | * INT_DEV_INTR_DWNCL (device interrupt) | ||
1046 | * INT_DMATLB_MISS_DWNCL (DMA TLB miss) | 1085 | * INT_DMATLB_MISS_DWNCL (DMA TLB miss) |
1047 | * INT_SNITLB_MISS_DWNCL (SNI TLB miss) | 1086 | * INT_SNITLB_MISS_DWNCL (SNI TLB miss) |
1048 | * INT_DMATLB_ACCESS_DWNCL (DMA TLB access violation) | 1087 | * INT_DMATLB_ACCESS_DWNCL (DMA TLB access violation) |