mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
Merge a9a4b7d9a6 ("Merge tag 'edac_updates_for_v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras") into android-mainline
Tiny steps on the way to 5.10-rc1. Change-Id: Ie45a2bfc60129510ce09763fdf38d374df92c38d Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/edac/amazon,al-mc-edac.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Amazon's Annapurna Labs Memory Controller EDAC
|
||||
|
||||
maintainers:
|
||||
- Talel Shenhar <talel@amazon.com>
|
||||
- Talel Shenhar <talelshenhar@gmail.com>
|
||||
|
||||
description: |
|
||||
EDAC node is defined to describe on-chip error detection and correction for
|
||||
Amazon's Annapurna Labs Memory Controller.
|
||||
|
||||
properties:
|
||||
|
||||
compatible:
|
||||
const: amazon,al-mc-edac
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
"#address-cells":
|
||||
const: 2
|
||||
|
||||
"#size-cells":
|
||||
const: 2
|
||||
|
||||
interrupts:
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
items:
|
||||
- description: uncorrectable error interrupt
|
||||
- description: correctable error interrupt
|
||||
|
||||
interrupt-names:
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
items:
|
||||
- const: ue
|
||||
- const: ce
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- "#address-cells"
|
||||
- "#size-cells"
|
||||
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
soc {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
edac@f0080000 {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
compatible = "amazon,al-mc-edac";
|
||||
reg = <0x0 0xf0080000 0x0 0x00010000>;
|
||||
interrupt-parent = <&amazon_al_system_fabric>;
|
||||
interrupt-names = "ue";
|
||||
interrupts = <20 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
};
|
||||
11
MAINTAINERS
11
MAINTAINERS
@@ -802,6 +802,13 @@ S: Maintained
|
||||
F: Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
|
||||
F: drivers/irqchip/irq-al-fic.c
|
||||
|
||||
AMAZON ANNAPURNA LABS MEMORY CONTROLLER EDAC
|
||||
M: Talel Shenhar <talel@amazon.com>
|
||||
M: Talel Shenhar <talelshenhar@gmail.com>
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/edac/amazon,al-mc-edac.yaml
|
||||
F: drivers/edac/al_mc_edac.c
|
||||
|
||||
AMAZON ANNAPURNA LABS THERMAL MMIO DRIVER
|
||||
M: Talel Shenhar <talel@amazon.com>
|
||||
S: Maintained
|
||||
@@ -2509,7 +2516,7 @@ S: Maintained
|
||||
F: drivers/clk/socfpga/
|
||||
|
||||
ARM/SOCFPGA EDAC SUPPORT
|
||||
M: Thor Thayer <thor.thayer@linux.intel.com>
|
||||
M: Dinh Nguyen <dinguyen@kernel.org>
|
||||
S: Maintained
|
||||
F: drivers/edac/altera_edac.
|
||||
|
||||
@@ -6184,7 +6191,7 @@ S: Supported
|
||||
F: drivers/edac/bluefield_edac.c
|
||||
|
||||
EDAC-CALXEDA
|
||||
M: Robert Richter <rric@kernel.org>
|
||||
M: Andre Przywara <andre.przywara@arm.com>
|
||||
L: linux-edac@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/edac/highbank*
|
||||
|
||||
@@ -6,32 +6,32 @@ config M68K
|
||||
select ARCH_HAS_BINFMT_FLAT
|
||||
select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE
|
||||
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
|
||||
select ARCH_NO_PREEMPT if !COLDFIRE
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
|
||||
select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
|
||||
select HAVE_IDE
|
||||
select GENERIC_ATOMIC64
|
||||
select GENERIC_CPU_DEVICES
|
||||
select GENERIC_IOMAP
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_STRNCPY_FROM_USER if MMU
|
||||
select GENERIC_STRNLEN_USER if MMU
|
||||
select HAVE_AOUT if MMU
|
||||
select HAVE_ASM_MODVERSIONS
|
||||
select HAVE_DEBUG_BUGVERBOSE
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_ATOMIC64
|
||||
select NO_DMA if !MMU && !COLDFIRE
|
||||
select HAVE_UID16
|
||||
select VIRT_TO_BUS
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
|
||||
select GENERIC_CPU_DEVICES
|
||||
select GENERIC_IOMAP
|
||||
select GENERIC_STRNCPY_FROM_USER if MMU
|
||||
select GENERIC_STRNLEN_USER if MMU
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
|
||||
select HAVE_IDE
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select HAVE_UID16
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select MODULES_USE_ELF_REL
|
||||
select MODULES_USE_ELF_RELA
|
||||
select OLD_SIGSUSPEND3
|
||||
select NO_DMA if !MMU && !COLDFIRE
|
||||
select OLD_SIGACTION
|
||||
select MMU_GATHER_NO_RANGE if MMU
|
||||
select OLD_SIGSUSPEND3
|
||||
select VIRT_TO_BUS
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
def_bool y
|
||||
|
||||
@@ -214,7 +214,7 @@ static void __init amiga_identify(void)
|
||||
|
||||
switch (amiga_model) {
|
||||
case AMI_UNKNOWN:
|
||||
goto Generic;
|
||||
break;
|
||||
|
||||
case AMI_600:
|
||||
case AMI_1200:
|
||||
@@ -227,7 +227,7 @@ static void __init amiga_identify(void)
|
||||
case AMI_2000:
|
||||
case AMI_2500:
|
||||
AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
|
||||
goto Generic;
|
||||
break;
|
||||
|
||||
case AMI_3000:
|
||||
case AMI_3000T:
|
||||
@@ -238,7 +238,7 @@ static void __init amiga_identify(void)
|
||||
AMIGAHW_SET(A3000_SCSI);
|
||||
AMIGAHW_SET(A3000_CLK);
|
||||
AMIGAHW_SET(ZORRO3);
|
||||
goto Generic;
|
||||
break;
|
||||
|
||||
case AMI_4000T:
|
||||
AMIGAHW_SET(A4000_SCSI);
|
||||
@@ -247,68 +247,12 @@ static void __init amiga_identify(void)
|
||||
AMIGAHW_SET(A4000_IDE);
|
||||
AMIGAHW_SET(A3000_CLK);
|
||||
AMIGAHW_SET(ZORRO3);
|
||||
goto Generic;
|
||||
break;
|
||||
|
||||
case AMI_CDTV:
|
||||
case AMI_CD32:
|
||||
AMIGAHW_SET(CD_ROM);
|
||||
AMIGAHW_SET(A2000_CLK); /* Is this correct? */
|
||||
goto Generic;
|
||||
|
||||
Generic:
|
||||
AMIGAHW_SET(AMI_VIDEO);
|
||||
AMIGAHW_SET(AMI_BLITTER);
|
||||
AMIGAHW_SET(AMI_AUDIO);
|
||||
AMIGAHW_SET(AMI_FLOPPY);
|
||||
AMIGAHW_SET(AMI_KEYBOARD);
|
||||
AMIGAHW_SET(AMI_MOUSE);
|
||||
AMIGAHW_SET(AMI_SERIAL);
|
||||
AMIGAHW_SET(AMI_PARALLEL);
|
||||
AMIGAHW_SET(CHIP_RAM);
|
||||
AMIGAHW_SET(PAULA);
|
||||
|
||||
switch (amiga_chipset) {
|
||||
case CS_OCS:
|
||||
case CS_ECS:
|
||||
case CS_AGA:
|
||||
switch (amiga_custom.deniseid & 0xf) {
|
||||
case 0x0c:
|
||||
AMIGAHW_SET(DENISE_HR);
|
||||
break;
|
||||
case 0x08:
|
||||
AMIGAHW_SET(LISA);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AMIGAHW_SET(DENISE);
|
||||
break;
|
||||
}
|
||||
switch ((amiga_custom.vposr>>8) & 0x7f) {
|
||||
case 0x00:
|
||||
AMIGAHW_SET(AGNUS_PAL);
|
||||
break;
|
||||
case 0x10:
|
||||
AMIGAHW_SET(AGNUS_NTSC);
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x21:
|
||||
AMIGAHW_SET(AGNUS_HR_PAL);
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x31:
|
||||
AMIGAHW_SET(AGNUS_HR_NTSC);
|
||||
break;
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
AMIGAHW_SET(ALICE_PAL);
|
||||
break;
|
||||
case 0x32:
|
||||
case 0x33:
|
||||
AMIGAHW_SET(ALICE_NTSC);
|
||||
break;
|
||||
}
|
||||
AMIGAHW_SET(ZORRO);
|
||||
break;
|
||||
|
||||
case AMI_DRACO:
|
||||
@@ -318,6 +262,60 @@ static void __init amiga_identify(void)
|
||||
panic("Unknown Amiga Model");
|
||||
}
|
||||
|
||||
AMIGAHW_SET(AMI_VIDEO);
|
||||
AMIGAHW_SET(AMI_BLITTER);
|
||||
AMIGAHW_SET(AMI_AUDIO);
|
||||
AMIGAHW_SET(AMI_FLOPPY);
|
||||
AMIGAHW_SET(AMI_KEYBOARD);
|
||||
AMIGAHW_SET(AMI_MOUSE);
|
||||
AMIGAHW_SET(AMI_SERIAL);
|
||||
AMIGAHW_SET(AMI_PARALLEL);
|
||||
AMIGAHW_SET(CHIP_RAM);
|
||||
AMIGAHW_SET(PAULA);
|
||||
|
||||
switch (amiga_chipset) {
|
||||
case CS_OCS:
|
||||
case CS_ECS:
|
||||
case CS_AGA:
|
||||
switch (amiga_custom.deniseid & 0xf) {
|
||||
case 0x0c:
|
||||
AMIGAHW_SET(DENISE_HR);
|
||||
break;
|
||||
case 0x08:
|
||||
AMIGAHW_SET(LISA);
|
||||
break;
|
||||
default:
|
||||
AMIGAHW_SET(DENISE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch ((amiga_custom.vposr>>8) & 0x7f) {
|
||||
case 0x00:
|
||||
AMIGAHW_SET(AGNUS_PAL);
|
||||
break;
|
||||
case 0x10:
|
||||
AMIGAHW_SET(AGNUS_NTSC);
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x21:
|
||||
AMIGAHW_SET(AGNUS_HR_PAL);
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x31:
|
||||
AMIGAHW_SET(AGNUS_HR_NTSC);
|
||||
break;
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
AMIGAHW_SET(ALICE_PAL);
|
||||
break;
|
||||
case 0x32:
|
||||
case 0x33:
|
||||
AMIGAHW_SET(ALICE_NTSC);
|
||||
break;
|
||||
}
|
||||
AMIGAHW_SET(ZORRO);
|
||||
|
||||
#define AMIGAHW_ANNOUNCE(name, str) \
|
||||
if (AMIGAHW_PRESENT(name)) \
|
||||
pr_cont(str)
|
||||
|
||||
@@ -317,6 +317,7 @@ CONFIG_DUMMY_IRQ=m
|
||||
CONFIG_IDE=y
|
||||
CONFIG_IDE_GD_ATAPI=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_BLK_DEV_PLATFORM=y
|
||||
CONFIG_BLK_DEV_MAC_IDE=y
|
||||
CONFIG_RAID_ATTRS=m
|
||||
CONFIG_SCSI=y
|
||||
|
||||
@@ -346,6 +346,7 @@ CONFIG_DUMMY_IRQ=m
|
||||
CONFIG_IDE=y
|
||||
CONFIG_IDE_GD_ATAPI=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_BLK_DEV_PLATFORM=y
|
||||
CONFIG_BLK_DEV_GAYLE=y
|
||||
CONFIG_BLK_DEV_BUDDHA=y
|
||||
CONFIG_BLK_DEV_FALCON_IDE=y
|
||||
|
||||
@@ -68,4 +68,12 @@ static inline struct thread_info *current_thread_info(void)
|
||||
#define TIF_MEMDIE 16 /* is terminating due to OOM killer */
|
||||
#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
|
||||
|
||||
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
||||
#define _TIF_DELAYED_TRACE (1 << TIF_DELAYED_TRACE)
|
||||
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
||||
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
|
||||
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
|
||||
|
||||
#endif /* _ASM_M68K_THREAD_INFO_H */
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
* Of course, readability is a subjective issue, so it will never be
|
||||
* argued that that goal was accomplished. It was merely a goal.
|
||||
* A key way to help make code more readable is to give good
|
||||
* documentation. So, the first thing you will find is exaustive
|
||||
* documentation. So, the first thing you will find is exhaustive
|
||||
* write-ups on the structure of the file, and the features of the
|
||||
* functional subroutines.
|
||||
*
|
||||
@@ -1304,7 +1304,7 @@ L(mmu_fixup_done):
|
||||
* mmu_engage
|
||||
*
|
||||
* This chunk of code performs the gruesome task of engaging the MMU.
|
||||
* The reason its gruesome is because when the MMU becomes engaged it
|
||||
* The reason it's gruesome is because when the MMU becomes engaged it
|
||||
* maps logical addresses to physical addresses. The Program Counter
|
||||
* register is then passed through the MMU before the next instruction
|
||||
* is fetched (the instruction following the engage MMU instruction).
|
||||
@@ -1369,7 +1369,7 @@ L(mmu_fixup_done):
|
||||
/*
|
||||
* After this point no new memory is allocated and
|
||||
* the start of available memory is stored in availmem.
|
||||
* (The bootmem allocator requires now the physicall address.)
|
||||
* (The bootmem allocator requires now the physical address.)
|
||||
*/
|
||||
|
||||
movel L(memory_start),availmem
|
||||
@@ -1547,7 +1547,7 @@ func_return get_bi_record
|
||||
* seven bits of the logical address (LA) are used as an
|
||||
* index into the "root table." Each entry in the root
|
||||
* table has a bit which specifies if it's a valid pointer to a
|
||||
* pointer table. Each entry defines a 32KMeg range of memory.
|
||||
* pointer table. Each entry defines a 32Meg range of memory.
|
||||
* If an entry is invalid then that logical range of 32M is
|
||||
* invalid and references to that range of memory (when the MMU
|
||||
* is enabled) will fault. If the entry is valid, then it does
|
||||
@@ -1584,7 +1584,7 @@ func_return get_bi_record
|
||||
* bits 17..12 - index into the Page Table
|
||||
* bits 11..0 - offset into a particular 4K page
|
||||
*
|
||||
* The algorithms which follows do one thing: they abstract
|
||||
* The algorithms which follow do one thing: they abstract
|
||||
* the MMU hardware. For example, there are three kinds of
|
||||
* cache settings that are relevant. Either, memory is
|
||||
* being mapped in which case it is either Kernel Code (or
|
||||
@@ -2082,7 +2082,7 @@ func_return mmu_map_tt
|
||||
* mmu_map
|
||||
*
|
||||
* This routine will map a range of memory using a pointer
|
||||
* table and allocating the pages on the fly from the kernel.
|
||||
* table and allocate the pages on the fly from the kernel.
|
||||
* The pointer table does not have to be already linked into
|
||||
* the root table, this routine will do that if necessary.
|
||||
*
|
||||
@@ -2528,7 +2528,7 @@ func_start mmu_get_root_table_entry,%d0/%a1
|
||||
|
||||
/* Find the start of free memory, get_bi_record does this for us,
|
||||
* as the bootinfo structure is located directly behind the kernel
|
||||
* and and we simply search for the last entry.
|
||||
* we simply search for the last entry.
|
||||
*/
|
||||
get_bi_record BI_LAST
|
||||
addw #PAGESIZE-1,%a0
|
||||
@@ -2654,7 +2654,7 @@ func_start mmu_get_page_table_entry,%d0/%a1
|
||||
jne 2f
|
||||
|
||||
/* If the page table entry doesn't exist, we allocate a complete new
|
||||
* page and use it as one continues big page table which can cover
|
||||
* page and use it as one continuous big page table which can cover
|
||||
* 4MB of memory, nearly almost all mappings have that alignment.
|
||||
*/
|
||||
get_new_page
|
||||
|
||||
@@ -845,7 +845,6 @@ static void show_trace(unsigned long *stack, const char *loglvl)
|
||||
void show_registers(struct pt_regs *regs)
|
||||
{
|
||||
struct frame *fp = (struct frame *)regs;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
u16 c, *cp;
|
||||
unsigned long addr;
|
||||
int i;
|
||||
@@ -918,10 +917,9 @@ void show_registers(struct pt_regs *regs)
|
||||
show_stack(NULL, (unsigned long *)addr, KERN_INFO);
|
||||
|
||||
pr_info("Code:");
|
||||
set_fs(KERNEL_DS);
|
||||
cp = (u16 *)regs->pc;
|
||||
for (i = -8; i < 16; i++) {
|
||||
if (get_user(c, cp + i) && i >= 0) {
|
||||
if (get_kernel_nofault(c, cp + i) && i >= 0) {
|
||||
pr_cont(" Bad PC value.");
|
||||
break;
|
||||
}
|
||||
@@ -930,7 +928,6 @@ void show_registers(struct pt_regs *regs)
|
||||
else
|
||||
pr_cont(" <%04x>", c);
|
||||
}
|
||||
set_fs(old_fs);
|
||||
pr_cont("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/vt_kern.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/adb.h>
|
||||
#include <linux/cuda.h>
|
||||
#include <linux/pmu.h>
|
||||
@@ -940,6 +941,26 @@ static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct resource mac_ide_quadra_rsrc[] __initconst = {
|
||||
DEFINE_RES_MEM(0x50F1A000, 0x104),
|
||||
DEFINE_RES_IRQ(IRQ_NUBUS_F),
|
||||
};
|
||||
|
||||
static const struct resource mac_ide_pb_rsrc[] __initconst = {
|
||||
DEFINE_RES_MEM(0x50F1A000, 0x104),
|
||||
DEFINE_RES_IRQ(IRQ_NUBUS_C),
|
||||
};
|
||||
|
||||
static const struct resource mac_pata_baboon_rsrc[] __initconst = {
|
||||
DEFINE_RES_MEM(0x50F1A000, 0x38),
|
||||
DEFINE_RES_MEM(0x50F1A038, 0x04),
|
||||
DEFINE_RES_IRQ(IRQ_BABOON_1),
|
||||
};
|
||||
|
||||
static const struct pata_platform_info mac_pata_baboon_data __initconst = {
|
||||
.ioport_shift = 2,
|
||||
};
|
||||
|
||||
int __init mac_platform_init(void)
|
||||
{
|
||||
phys_addr_t swim_base = 0;
|
||||
@@ -1048,6 +1069,26 @@ int __init mac_platform_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* IDE device
|
||||
*/
|
||||
|
||||
switch (macintosh_config->ide_type) {
|
||||
case MAC_IDE_QUADRA:
|
||||
platform_device_register_simple("mac_ide", -1,
|
||||
mac_ide_quadra_rsrc, ARRAY_SIZE(mac_ide_quadra_rsrc));
|
||||
break;
|
||||
case MAC_IDE_PB:
|
||||
platform_device_register_simple("mac_ide", -1,
|
||||
mac_ide_pb_rsrc, ARRAY_SIZE(mac_ide_pb_rsrc));
|
||||
break;
|
||||
case MAC_IDE_BABOON:
|
||||
platform_device_register_resndata(NULL, "pata_platform", -1,
|
||||
mac_pata_baboon_rsrc, ARRAY_SIZE(mac_pata_baboon_rsrc),
|
||||
&mac_pata_baboon_data, sizeof(mac_pata_baboon_data));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ethernet device
|
||||
*/
|
||||
|
||||
@@ -116,7 +116,7 @@ static void mac_init_asc( void )
|
||||
* support 16-bit stereo output, but only mono input."
|
||||
*
|
||||
* Technical Information Library (TIL) article number 16405.
|
||||
* http://support.apple.com/kb/TA32601
|
||||
* https://support.apple.com/kb/TA32601
|
||||
*
|
||||
* --David Kilzer
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ void __init paging_init(void)
|
||||
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
|
||||
int i;
|
||||
|
||||
empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
|
||||
empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
|
||||
if (!empty_zero_page)
|
||||
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
|
||||
__func__, PAGE_SIZE, PAGE_SIZE);
|
||||
|
||||
@@ -226,8 +226,8 @@ static pte_t * __init kernel_page_table(void)
|
||||
{
|
||||
pte_t *pte_table = last_pte_table;
|
||||
|
||||
if (((unsigned long)last_pte_table & ~PAGE_MASK) == 0) {
|
||||
pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
|
||||
if (PAGE_ALIGNED(last_pte_table)) {
|
||||
pte_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
|
||||
if (!pte_table) {
|
||||
panic("%s: Failed to allocate %lu bytes align=%lx\n",
|
||||
__func__, PAGE_SIZE, PAGE_SIZE);
|
||||
@@ -274,9 +274,8 @@ static pmd_t * __init kernel_ptr_table(void)
|
||||
}
|
||||
|
||||
last_pmd_table += PTRS_PER_PMD;
|
||||
if (((unsigned long)last_pmd_table & ~PAGE_MASK) == 0) {
|
||||
last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
|
||||
PAGE_SIZE);
|
||||
if (PAGE_ALIGNED(last_pmd_table)) {
|
||||
last_pmd_table = memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
|
||||
if (!last_pmd_table)
|
||||
panic("%s: Failed to allocate %lu bytes align=%lx\n",
|
||||
__func__, PAGE_SIZE, PAGE_SIZE);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
generated-y += syscall_table.h
|
||||
generic-y += extable.h
|
||||
generic-y += hw_irq.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += local64.h
|
||||
generic-y += mcs_spinlock.h
|
||||
|
||||
@@ -100,6 +100,13 @@ config EDAC_AMD64_ERROR_INJECTION
|
||||
In addition, there are two control files, inject_read and inject_write,
|
||||
which trigger the DRAM ECC Read and Write respectively.
|
||||
|
||||
config EDAC_AL_MC
|
||||
tristate "Amazon's Annapurna Lab Memory Controller"
|
||||
depends on (ARCH_ALPINE || COMPILE_TEST)
|
||||
help
|
||||
Support for error detection and correction for Amazon's Annapurna
|
||||
Labs Alpine chips which allow 1 bit correction and 2 bits detection.
|
||||
|
||||
config EDAC_AMD76X
|
||||
tristate "AMD 76x (760, 762, 768)"
|
||||
depends on PCI && X86_32
|
||||
|
||||
@@ -22,6 +22,7 @@ obj-$(CONFIG_EDAC_GHES) += ghes_edac.o
|
||||
edac_mce_amd-y := mce_amd.o
|
||||
obj-$(CONFIG_EDAC_DECODE_MCE) += edac_mce_amd.o
|
||||
|
||||
obj-$(CONFIG_EDAC_AL_MC) += al_mc_edac.o
|
||||
obj-$(CONFIG_EDAC_AMD76X) += amd76x_edac.o
|
||||
obj-$(CONFIG_EDAC_CPC925) += cpc925_edac.o
|
||||
obj-$(CONFIG_EDAC_I5000) += i5000_edac.o
|
||||
|
||||
354
drivers/edac/al_mc_edac.c
Normal file
354
drivers/edac/al_mc_edac.c
Normal file
@@ -0,0 +1,354 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*/
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/edac.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include "edac_module.h"
|
||||
|
||||
/* Registers Offset */
|
||||
#define AL_MC_ECC_CFG 0x70
|
||||
#define AL_MC_ECC_CLEAR 0x7c
|
||||
#define AL_MC_ECC_ERR_COUNT 0x80
|
||||
#define AL_MC_ECC_CE_ADDR0 0x84
|
||||
#define AL_MC_ECC_CE_ADDR1 0x88
|
||||
#define AL_MC_ECC_UE_ADDR0 0xa4
|
||||
#define AL_MC_ECC_UE_ADDR1 0xa8
|
||||
#define AL_MC_ECC_CE_SYND0 0x8c
|
||||
#define AL_MC_ECC_CE_SYND1 0x90
|
||||
#define AL_MC_ECC_CE_SYND2 0x94
|
||||
#define AL_MC_ECC_UE_SYND0 0xac
|
||||
#define AL_MC_ECC_UE_SYND1 0xb0
|
||||
#define AL_MC_ECC_UE_SYND2 0xb4
|
||||
|
||||
/* Registers Fields */
|
||||
#define AL_MC_ECC_CFG_SCRUB_DISABLED BIT(4)
|
||||
|
||||
#define AL_MC_ECC_CLEAR_UE_COUNT BIT(3)
|
||||
#define AL_MC_ECC_CLEAR_CE_COUNT BIT(2)
|
||||
#define AL_MC_ECC_CLEAR_UE_ERR BIT(1)
|
||||
#define AL_MC_ECC_CLEAR_CE_ERR BIT(0)
|
||||
|
||||
#define AL_MC_ECC_ERR_COUNT_UE GENMASK(31, 16)
|
||||
#define AL_MC_ECC_ERR_COUNT_CE GENMASK(15, 0)
|
||||
|
||||
#define AL_MC_ECC_CE_ADDR0_RANK GENMASK(25, 24)
|
||||
#define AL_MC_ECC_CE_ADDR0_ROW GENMASK(17, 0)
|
||||
|
||||
#define AL_MC_ECC_CE_ADDR1_BG GENMASK(25, 24)
|
||||
#define AL_MC_ECC_CE_ADDR1_BANK GENMASK(18, 16)
|
||||
#define AL_MC_ECC_CE_ADDR1_COLUMN GENMASK(11, 0)
|
||||
|
||||
#define AL_MC_ECC_UE_ADDR0_RANK GENMASK(25, 24)
|
||||
#define AL_MC_ECC_UE_ADDR0_ROW GENMASK(17, 0)
|
||||
|
||||
#define AL_MC_ECC_UE_ADDR1_BG GENMASK(25, 24)
|
||||
#define AL_MC_ECC_UE_ADDR1_BANK GENMASK(18, 16)
|
||||
#define AL_MC_ECC_UE_ADDR1_COLUMN GENMASK(11, 0)
|
||||
|
||||
#define DRV_NAME "al_mc_edac"
|
||||
#define AL_MC_EDAC_MSG_MAX 256
|
||||
|
||||
struct al_mc_edac {
|
||||
void __iomem *mmio_base;
|
||||
spinlock_t lock;
|
||||
int irq_ce;
|
||||
int irq_ue;
|
||||
};
|
||||
|
||||
static void prepare_msg(char *message, size_t buffer_size,
|
||||
enum hw_event_mc_err_type type,
|
||||
u8 rank, u32 row, u8 bg, u8 bank, u16 column,
|
||||
u32 syn0, u32 syn1, u32 syn2)
|
||||
{
|
||||
snprintf(message, buffer_size,
|
||||
"%s rank=0x%x row=0x%x bg=0x%x bank=0x%x col=0x%x syn0: 0x%x syn1: 0x%x syn2: 0x%x",
|
||||
type == HW_EVENT_ERR_UNCORRECTED ? "UE" : "CE",
|
||||
rank, row, bg, bank, column, syn0, syn1, syn2);
|
||||
}
|
||||
|
||||
static int handle_ce(struct mem_ctl_info *mci)
|
||||
{
|
||||
u32 eccerrcnt, ecccaddr0, ecccaddr1, ecccsyn0, ecccsyn1, ecccsyn2, row;
|
||||
struct al_mc_edac *al_mc = mci->pvt_info;
|
||||
char msg[AL_MC_EDAC_MSG_MAX];
|
||||
u16 ce_count, column;
|
||||
unsigned long flags;
|
||||
u8 rank, bg, bank;
|
||||
|
||||
eccerrcnt = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_ERR_COUNT);
|
||||
ce_count = FIELD_GET(AL_MC_ECC_ERR_COUNT_CE, eccerrcnt);
|
||||
if (!ce_count)
|
||||
return 0;
|
||||
|
||||
ecccaddr0 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_CE_ADDR0);
|
||||
ecccaddr1 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_CE_ADDR1);
|
||||
ecccsyn0 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_CE_SYND0);
|
||||
ecccsyn1 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_CE_SYND1);
|
||||
ecccsyn2 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_CE_SYND2);
|
||||
|
||||
writel_relaxed(AL_MC_ECC_CLEAR_CE_COUNT | AL_MC_ECC_CLEAR_CE_ERR,
|
||||
al_mc->mmio_base + AL_MC_ECC_CLEAR);
|
||||
|
||||
dev_dbg(mci->pdev, "eccuaddr0=0x%08x eccuaddr1=0x%08x\n",
|
||||
ecccaddr0, ecccaddr1);
|
||||
|
||||
rank = FIELD_GET(AL_MC_ECC_CE_ADDR0_RANK, ecccaddr0);
|
||||
row = FIELD_GET(AL_MC_ECC_CE_ADDR0_ROW, ecccaddr0);
|
||||
|
||||
bg = FIELD_GET(AL_MC_ECC_CE_ADDR1_BG, ecccaddr1);
|
||||
bank = FIELD_GET(AL_MC_ECC_CE_ADDR1_BANK, ecccaddr1);
|
||||
column = FIELD_GET(AL_MC_ECC_CE_ADDR1_COLUMN, ecccaddr1);
|
||||
|
||||
prepare_msg(msg, sizeof(msg), HW_EVENT_ERR_CORRECTED,
|
||||
rank, row, bg, bank, column,
|
||||
ecccsyn0, ecccsyn1, ecccsyn2);
|
||||
|
||||
spin_lock_irqsave(&al_mc->lock, flags);
|
||||
edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci,
|
||||
ce_count, 0, 0, 0, 0, 0, -1, mci->ctl_name, msg);
|
||||
spin_unlock_irqrestore(&al_mc->lock, flags);
|
||||
|
||||
return ce_count;
|
||||
}
|
||||
|
||||
static int handle_ue(struct mem_ctl_info *mci)
|
||||
{
|
||||
u32 eccerrcnt, eccuaddr0, eccuaddr1, eccusyn0, eccusyn1, eccusyn2, row;
|
||||
struct al_mc_edac *al_mc = mci->pvt_info;
|
||||
char msg[AL_MC_EDAC_MSG_MAX];
|
||||
u16 ue_count, column;
|
||||
unsigned long flags;
|
||||
u8 rank, bg, bank;
|
||||
|
||||
eccerrcnt = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_ERR_COUNT);
|
||||
ue_count = FIELD_GET(AL_MC_ECC_ERR_COUNT_UE, eccerrcnt);
|
||||
if (!ue_count)
|
||||
return 0;
|
||||
|
||||
eccuaddr0 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_UE_ADDR0);
|
||||
eccuaddr1 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_UE_ADDR1);
|
||||
eccusyn0 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_UE_SYND0);
|
||||
eccusyn1 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_UE_SYND1);
|
||||
eccusyn2 = readl_relaxed(al_mc->mmio_base + AL_MC_ECC_UE_SYND2);
|
||||
|
||||
writel_relaxed(AL_MC_ECC_CLEAR_UE_COUNT | AL_MC_ECC_CLEAR_UE_ERR,
|
||||
al_mc->mmio_base + AL_MC_ECC_CLEAR);
|
||||
|
||||
dev_dbg(mci->pdev, "eccuaddr0=0x%08x eccuaddr1=0x%08x\n",
|
||||
eccuaddr0, eccuaddr1);
|
||||
|
||||
rank = FIELD_GET(AL_MC_ECC_UE_ADDR0_RANK, eccuaddr0);
|
||||
row = FIELD_GET(AL_MC_ECC_UE_ADDR0_ROW, eccuaddr0);
|
||||
|
||||
bg = FIELD_GET(AL_MC_ECC_UE_ADDR1_BG, eccuaddr1);
|
||||
bank = FIELD_GET(AL_MC_ECC_UE_ADDR1_BANK, eccuaddr1);
|
||||
column = FIELD_GET(AL_MC_ECC_UE_ADDR1_COLUMN, eccuaddr1);
|
||||
|
||||
prepare_msg(msg, sizeof(msg), HW_EVENT_ERR_UNCORRECTED,
|
||||
rank, row, bg, bank, column,
|
||||
eccusyn0, eccusyn1, eccusyn2);
|
||||
|
||||
spin_lock_irqsave(&al_mc->lock, flags);
|
||||
edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
|
||||
ue_count, 0, 0, 0, 0, 0, -1, mci->ctl_name, msg);
|
||||
spin_unlock_irqrestore(&al_mc->lock, flags);
|
||||
|
||||
return ue_count;
|
||||
}
|
||||
|
||||
static void al_mc_edac_check(struct mem_ctl_info *mci)
|
||||
{
|
||||
struct al_mc_edac *al_mc = mci->pvt_info;
|
||||
|
||||
if (al_mc->irq_ue <= 0)
|
||||
handle_ue(mci);
|
||||
|
||||
if (al_mc->irq_ce <= 0)
|
||||
handle_ce(mci);
|
||||
}
|
||||
|
||||
static irqreturn_t al_mc_edac_irq_handler_ue(int irq, void *info)
|
||||
{
|
||||
struct platform_device *pdev = info;
|
||||
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
|
||||
|
||||
if (handle_ue(mci))
|
||||
return IRQ_HANDLED;
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
static irqreturn_t al_mc_edac_irq_handler_ce(int irq, void *info)
|
||||
{
|
||||
struct platform_device *pdev = info;
|
||||
struct mem_ctl_info *mci = platform_get_drvdata(pdev);
|
||||
|
||||
if (handle_ce(mci))
|
||||
return IRQ_HANDLED;
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
static enum scrub_type get_scrub_mode(void __iomem *mmio_base)
|
||||
{
|
||||
u32 ecccfg0;
|
||||
|
||||
ecccfg0 = readl(mmio_base + AL_MC_ECC_CFG);
|
||||
|
||||
if (FIELD_GET(AL_MC_ECC_CFG_SCRUB_DISABLED, ecccfg0))
|
||||
return SCRUB_NONE;
|
||||
else
|
||||
return SCRUB_HW_SRC;
|
||||
}
|
||||
|
||||
static void devm_al_mc_edac_free(void *data)
|
||||
{
|
||||
edac_mc_free(data);
|
||||
}
|
||||
|
||||
static void devm_al_mc_edac_del(void *data)
|
||||
{
|
||||
edac_mc_del_mc(data);
|
||||
}
|
||||
|
||||
static int al_mc_edac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct edac_mc_layer layers[1];
|
||||
struct mem_ctl_info *mci;
|
||||
struct al_mc_edac *al_mc;
|
||||
void __iomem *mmio_base;
|
||||
struct dimm_info *dimm;
|
||||
int ret;
|
||||
|
||||
mmio_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(mmio_base)) {
|
||||
dev_err(&pdev->dev, "failed to ioremap memory (%ld)\n",
|
||||
PTR_ERR(mmio_base));
|
||||
return PTR_ERR(mmio_base);
|
||||
}
|
||||
|
||||
layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
|
||||
layers[0].size = 1;
|
||||
layers[0].is_virt_csrow = false;
|
||||
mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
|
||||
sizeof(struct al_mc_edac));
|
||||
if (!mci)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = devm_add_action(&pdev->dev, devm_al_mc_edac_free, mci);
|
||||
if (ret) {
|
||||
edac_mc_free(mci);
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, mci);
|
||||
al_mc = mci->pvt_info;
|
||||
|
||||
al_mc->mmio_base = mmio_base;
|
||||
|
||||
al_mc->irq_ue = of_irq_get_byname(pdev->dev.of_node, "ue");
|
||||
if (al_mc->irq_ue <= 0)
|
||||
dev_dbg(&pdev->dev,
|
||||
"no IRQ defined for UE - falling back to polling\n");
|
||||
|
||||
al_mc->irq_ce = of_irq_get_byname(pdev->dev.of_node, "ce");
|
||||
if (al_mc->irq_ce <= 0)
|
||||
dev_dbg(&pdev->dev,
|
||||
"no IRQ defined for CE - falling back to polling\n");
|
||||
|
||||
/*
|
||||
* In case both interrupts (ue/ce) are to be found, use interrupt mode.
|
||||
* In case none of the interrupt are foud, use polling mode.
|
||||
* In case only one interrupt is found, use interrupt mode for it but
|
||||
* keep polling mode enable for the other.
|
||||
*/
|
||||
if (al_mc->irq_ue <= 0 || al_mc->irq_ce <= 0) {
|
||||
edac_op_state = EDAC_OPSTATE_POLL;
|
||||
mci->edac_check = al_mc_edac_check;
|
||||
} else {
|
||||
edac_op_state = EDAC_OPSTATE_INT;
|
||||
}
|
||||
|
||||
spin_lock_init(&al_mc->lock);
|
||||
|
||||
mci->mtype_cap = MEM_FLAG_DDR3 | MEM_FLAG_DDR4;
|
||||
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
|
||||
mci->edac_cap = EDAC_FLAG_SECDED;
|
||||
mci->mod_name = DRV_NAME;
|
||||
mci->ctl_name = "al_mc";
|
||||
mci->pdev = &pdev->dev;
|
||||
mci->scrub_mode = get_scrub_mode(mmio_base);
|
||||
|
||||
dimm = *mci->dimms;
|
||||
dimm->grain = 1;
|
||||
|
||||
ret = edac_mc_add_mc(mci);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"fail to add memory controller device (%d)\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = devm_add_action(&pdev->dev, devm_al_mc_edac_del, &pdev->dev);
|
||||
if (ret) {
|
||||
edac_mc_del_mc(&pdev->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (al_mc->irq_ue > 0) {
|
||||
ret = devm_request_irq(&pdev->dev,
|
||||
al_mc->irq_ue,
|
||||
al_mc_edac_irq_handler_ue,
|
||||
IRQF_SHARED,
|
||||
pdev->name,
|
||||
pdev);
|
||||
if (ret != 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"failed to request UE IRQ %d (%d)\n",
|
||||
al_mc->irq_ue, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (al_mc->irq_ce > 0) {
|
||||
ret = devm_request_irq(&pdev->dev,
|
||||
al_mc->irq_ce,
|
||||
al_mc_edac_irq_handler_ce,
|
||||
IRQF_SHARED,
|
||||
pdev->name,
|
||||
pdev);
|
||||
if (ret != 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"failed to request CE IRQ %d (%d)\n",
|
||||
al_mc->irq_ce, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id al_mc_edac_of_match[] = {
|
||||
{ .compatible = "amazon,al-mc-edac", },
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, al_mc_edac_of_match);
|
||||
|
||||
static struct platform_driver al_mc_edac_driver = {
|
||||
.probe = al_mc_edac_probe,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = al_mc_edac_of_match,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(al_mc_edac_driver);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Talel Shenhar");
|
||||
MODULE_DESCRIPTION("Amazon's Annapurna Lab's Memory Controller EDAC Driver");
|
||||
@@ -3385,6 +3385,12 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
|
||||
break;
|
||||
|
||||
case 0x19:
|
||||
if (pvt->model >= 0x20 && pvt->model <= 0x2f) {
|
||||
fam_type = &family_types[F17_M70H_CPUS];
|
||||
pvt->ops = &family_types[F17_M70H_CPUS].ops;
|
||||
fam_type->ctl_name = "F19h_M20h";
|
||||
break;
|
||||
}
|
||||
fam_type = &family_types[F19_CPUS];
|
||||
pvt->ops = &family_types[F19_CPUS].ops;
|
||||
family_types[F19_CPUS].ctl_name = "F19h";
|
||||
|
||||
@@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev)
|
||||
/* register interrupt handler */
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
dev_dbg(&pdev->dev, "got irq %d\n", irq);
|
||||
if (!irq)
|
||||
return -ENODEV;
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH,
|
||||
DRV_NAME, ctx);
|
||||
@@ -388,23 +388,7 @@ static struct platform_driver aspeed_driver = {
|
||||
.probe = aspeed_probe,
|
||||
.remove = aspeed_remove
|
||||
};
|
||||
|
||||
|
||||
static int __init aspeed_init(void)
|
||||
{
|
||||
return platform_driver_register(&aspeed_driver);
|
||||
}
|
||||
|
||||
|
||||
static void __exit aspeed_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&aspeed_driver);
|
||||
}
|
||||
|
||||
|
||||
module_init(aspeed_init);
|
||||
module_exit(aspeed_exit);
|
||||
|
||||
module_platform_driver(aspeed_driver);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Stefan Schaeckeler <sschaeck@cisco.com>");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Implement support for the e7520, E7525, e7320 and i3100 memory controllers.
|
||||
*
|
||||
* Datasheets:
|
||||
* http://www.intel.in/content/www/in/en/chipsets/e7525-memory-controller-hub-datasheet.html
|
||||
* https://www.intel.in/content/www/in/en/chipsets/e7525-memory-controller-hub-datasheet.html
|
||||
* ftp://download.intel.com/design/intarch/datashts/31345803.pdf
|
||||
*
|
||||
* Written by Tom Zimmerman
|
||||
|
||||
@@ -474,8 +474,12 @@ static ssize_t dimmdev_location_show(struct device *dev,
|
||||
struct device_attribute *mattr, char *data)
|
||||
{
|
||||
struct dimm_info *dimm = to_dimm(dev);
|
||||
ssize_t count;
|
||||
|
||||
return edac_dimm_info_location(dimm, data, PAGE_SIZE);
|
||||
count = edac_dimm_info_location(dimm, data, PAGE_SIZE);
|
||||
count += scnprintf(data + count, PAGE_SIZE - count, "\n");
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t dimmdev_label_show(struct device *dev,
|
||||
@@ -813,15 +817,23 @@ static ssize_t mci_max_location_show(struct device *dev,
|
||||
char *data)
|
||||
{
|
||||
struct mem_ctl_info *mci = to_mci(dev);
|
||||
int i;
|
||||
int len = PAGE_SIZE;
|
||||
char *p = data;
|
||||
int i, n;
|
||||
|
||||
for (i = 0; i < mci->n_layers; i++) {
|
||||
p += sprintf(p, "%s %d ",
|
||||
edac_layer_name[mci->layers[i].type],
|
||||
mci->layers[i].size - 1);
|
||||
n = scnprintf(p, len, "%s %d ",
|
||||
edac_layer_name[mci->layers[i].type],
|
||||
mci->layers[i].size - 1);
|
||||
len -= n;
|
||||
if (len <= 0)
|
||||
goto out;
|
||||
|
||||
p += n;
|
||||
}
|
||||
|
||||
p += scnprintf(p, len, "\n");
|
||||
out:
|
||||
return p - data;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Copyright (c) 2013 by Mauro Carvalho Chehab
|
||||
*
|
||||
* Red Hat Inc. http://www.redhat.com
|
||||
* Red Hat Inc. https://www.redhat.com
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
@@ -1061,16 +1061,15 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
PCI_DEVICE_ID_INTEL_5100_19, 0);
|
||||
if (!einj) {
|
||||
ret = -ENODEV;
|
||||
goto bail_einj;
|
||||
goto bail_mc_free;
|
||||
}
|
||||
|
||||
rc = pci_enable_device(einj);
|
||||
if (rc < 0) {
|
||||
ret = rc;
|
||||
goto bail_disable_einj;
|
||||
goto bail_einj;
|
||||
}
|
||||
|
||||
|
||||
mci->pdev = &pdev->dev;
|
||||
|
||||
priv = mci->pvt_info;
|
||||
@@ -1136,14 +1135,14 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
bail_scrub:
|
||||
priv->scrub_enable = 0;
|
||||
cancel_delayed_work_sync(&(priv->i5100_scrubbing));
|
||||
edac_mc_free(mci);
|
||||
|
||||
bail_disable_einj:
|
||||
pci_disable_device(einj);
|
||||
|
||||
bail_einj:
|
||||
pci_dev_put(einj);
|
||||
|
||||
bail_mc_free:
|
||||
edac_mc_free(mci);
|
||||
|
||||
bail_disable_ch1:
|
||||
pci_disable_device(ch1mm);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Ben Woodard <woodard@redhat.com>
|
||||
* Mauro Carvalho Chehab
|
||||
*
|
||||
* Red Hat Inc. http://www.redhat.com
|
||||
* Red Hat Inc. https://www.redhat.com
|
||||
*
|
||||
* Forked and adapted from the i5000_edac driver which was
|
||||
* written by Douglas Thompson Linux Networx <norsk5@xmission.com>
|
||||
@@ -1460,7 +1460,7 @@ module_exit(i5400_exit);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Ben Woodard <woodard@redhat.com>");
|
||||
MODULE_AUTHOR("Mauro Carvalho Chehab");
|
||||
MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
|
||||
MODULE_AUTHOR("Red Hat Inc. (https://www.redhat.com)");
|
||||
MODULE_DESCRIPTION("MC Driver for Intel I5400 memory controllers - "
|
||||
I5400_REVISION);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (c) 2010 by:
|
||||
* Mauro Carvalho Chehab
|
||||
*
|
||||
* Red Hat Inc. http://www.redhat.com
|
||||
* Red Hat Inc. https://www.redhat.com
|
||||
*
|
||||
* Intel 7300 Chipset Memory Controller Hub (MCH) - Datasheet
|
||||
* http://www.intel.com/Assets/PDF/datasheet/318082.pdf
|
||||
@@ -1206,7 +1206,7 @@ module_exit(i7300_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Mauro Carvalho Chehab");
|
||||
MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
|
||||
MODULE_AUTHOR("Red Hat Inc. (https://www.redhat.com)");
|
||||
MODULE_DESCRIPTION("MC Driver for Intel I7300 memory controllers - "
|
||||
I7300_REVISION);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Copyright (c) 2009-2010 by:
|
||||
* Mauro Carvalho Chehab
|
||||
*
|
||||
* Red Hat Inc. http://www.redhat.com
|
||||
* Red Hat Inc. https://www.redhat.com
|
||||
*
|
||||
* Forked and adapted from the i5400_edac driver
|
||||
*
|
||||
@@ -2391,7 +2391,7 @@ module_exit(i7core_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Mauro Carvalho Chehab");
|
||||
MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
|
||||
MODULE_AUTHOR("Red Hat Inc. (https://www.redhat.com)");
|
||||
MODULE_DESCRIPTION("MC Driver for Intel i7 Core memory controllers - "
|
||||
I7CORE_REVISION);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Since the DRAM controller is on the cpu chip, we can use its PCI device
|
||||
* id to identify these processors.
|
||||
*
|
||||
* PCI DRAM controller device ids (Taken from The PCI ID Repository - http://pci-ids.ucw.cz/)
|
||||
* PCI DRAM controller device ids (Taken from The PCI ID Repository - https://pci-ids.ucw.cz/)
|
||||
*
|
||||
* 0108: Xeon E3-1200 Processor Family DRAM Controller
|
||||
* 010c: Xeon E3-1200/2nd Generation Core Processor Family DRAM Controller
|
||||
@@ -23,9 +23,9 @@
|
||||
* 3e..: 8th/9th Gen Core Processor Host Bridge/DRAM Registers
|
||||
*
|
||||
* Based on Intel specification:
|
||||
* http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/xeon-e3-1200v3-vol-2-datasheet.pdf
|
||||
* https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/xeon-e3-1200v3-vol-2-datasheet.pdf
|
||||
* http://www.intel.com/content/www/us/en/processors/xeon/xeon-e3-1200-family-vol-2-datasheet.html
|
||||
* http://www.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-h-processor-lines-datasheet-vol-2.html
|
||||
* https://www.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-h-processor-lines-datasheet-vol-2.html
|
||||
* https://www.intel.com/content/www/us/en/products/docs/processors/core/8th-gen-core-family-datasheet-vol-2.html
|
||||
*
|
||||
* According to the above datasheet (p.16):
|
||||
|
||||
@@ -210,6 +210,11 @@ static const char * const smca_if_mce_desc[] = {
|
||||
"L2 BTB Multi-Match Error",
|
||||
"L2 Cache Response Poison Error",
|
||||
"System Read Data Error",
|
||||
"Hardware Assertion Error",
|
||||
"L1-TLB Multi-Hit",
|
||||
"L2-TLB Multi-Hit",
|
||||
"BSR Parity Error",
|
||||
"CT MCE",
|
||||
};
|
||||
|
||||
static const char * const smca_l2_mce_desc[] = {
|
||||
@@ -228,7 +233,8 @@ static const char * const smca_de_mce_desc[] = {
|
||||
"Fetch address FIFO parity error",
|
||||
"Patch RAM data parity error",
|
||||
"Patch RAM sequencer parity error",
|
||||
"Micro-op buffer parity error"
|
||||
"Micro-op buffer parity error",
|
||||
"Hardware Assertion MCA Error",
|
||||
};
|
||||
|
||||
static const char * const smca_ex_mce_desc[] = {
|
||||
@@ -244,6 +250,8 @@ static const char * const smca_ex_mce_desc[] = {
|
||||
"Scheduling queue parity error",
|
||||
"Branch buffer queue parity error",
|
||||
"Hardware Assertion error",
|
||||
"Spec Map parity error",
|
||||
"Retire Map parity error",
|
||||
};
|
||||
|
||||
static const char * const smca_fp_mce_desc[] = {
|
||||
@@ -360,6 +368,7 @@ static const char * const smca_smu2_mce_desc[] = {
|
||||
"Instruction Tag Cache Bank A ECC or parity error",
|
||||
"Instruction Tag Cache Bank B ECC or parity error",
|
||||
"System Hub Read Buffer ECC or parity error",
|
||||
"PHY RAM ECC error",
|
||||
};
|
||||
|
||||
static const char * const smca_mp5_mce_desc[] = {
|
||||
|
||||
@@ -939,12 +939,9 @@ static enum dev_type sbridge_get_width(struct sbridge_pvt *pvt, u32 mtr)
|
||||
|
||||
static enum dev_type __ibridge_get_width(u32 mtr)
|
||||
{
|
||||
enum dev_type type;
|
||||
enum dev_type type = DEV_UNKNOWN;
|
||||
|
||||
switch (mtr) {
|
||||
case 3:
|
||||
type = DEV_UNKNOWN;
|
||||
break;
|
||||
case 2:
|
||||
type = DEV_X16;
|
||||
break;
|
||||
@@ -3552,6 +3549,6 @@ MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Mauro Carvalho Chehab");
|
||||
MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
|
||||
MODULE_AUTHOR("Red Hat Inc. (https://www.redhat.com)");
|
||||
MODULE_DESCRIPTION("MC Driver for Intel Sandy Bridge and Ivy Bridge memory controllers - "
|
||||
SBRIDGE_REVISION);
|
||||
|
||||
@@ -454,7 +454,7 @@ DEBUGFS_STRUCT(inject_int, 0200, thunderx_lmc_inject_int_write, NULL);
|
||||
DEBUGFS_STRUCT(inject_ecc, 0200, thunderx_lmc_inject_ecc_write, NULL);
|
||||
DEBUGFS_STRUCT(int_w1c, 0400, NULL, thunderx_lmc_int_read);
|
||||
|
||||
struct debugfs_entry *lmc_dfs_ents[] = {
|
||||
static struct debugfs_entry *lmc_dfs_ents[] = {
|
||||
&debugfs_mask0,
|
||||
&debugfs_mask2,
|
||||
&debugfs_parity_test,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
|
||||
* Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/
|
||||
*
|
||||
* Texas Instruments DDR3 ECC error correction and detection driver
|
||||
*
|
||||
@@ -278,7 +278,8 @@ static int ti_edac_probe(struct platform_device *pdev)
|
||||
|
||||
/* add EMIF ECC error handler */
|
||||
error_irq = platform_get_irq(pdev, 0);
|
||||
if (!error_irq) {
|
||||
if (error_irq < 0) {
|
||||
ret = error_irq;
|
||||
edac_printk(KERN_ERR, EDAC_MOD_NAME,
|
||||
"EMIF irq number not defined.\n");
|
||||
goto err;
|
||||
|
||||
@@ -744,9 +744,10 @@ config BLK_DEV_MAC_IDE
|
||||
depends on MAC
|
||||
help
|
||||
This is the IDE driver for the on-board IDE interface on some m68k
|
||||
Macintosh models. It supports both the `Quadra style' (used in
|
||||
Quadra/ Centris 630 and Performa 588 models) and `Powerbook style'
|
||||
(used in the Powerbook 150 and 190 models) IDE interface.
|
||||
Macintosh models, namely Quadra/Centris 630, Performa 588 and
|
||||
Powerbook 150. The IDE interface on the Powerbook 190 is not
|
||||
supported by this driver and requires BLK_DEV_PLATFORM or
|
||||
PATA_PLATFORM.
|
||||
|
||||
Say Y if you have such an Macintosh model and want to use IDE
|
||||
devices (hard disks, CD-ROM drives, etc.) that are connected to the
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/ide.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/macintosh.h>
|
||||
#include <asm/macints.h>
|
||||
#include <asm/mac_baboon.h>
|
||||
|
||||
#define DRV_NAME "mac_ide"
|
||||
|
||||
#define IDE_BASE 0x50F1A000 /* Base address of IDE controller */
|
||||
|
||||
@@ -100,42 +101,61 @@ static const char *mac_ide_name[] =
|
||||
* Probe for a Macintosh IDE interface
|
||||
*/
|
||||
|
||||
static int __init macide_init(void)
|
||||
static int mac_ide_probe(struct platform_device *pdev)
|
||||
{
|
||||
unsigned long base;
|
||||
int irq;
|
||||
struct resource *mem, *irq;
|
||||
struct ide_hw hw, *hws[] = { &hw };
|
||||
struct ide_port_info d = macide_port_info;
|
||||
struct ide_host *host;
|
||||
int rc;
|
||||
|
||||
if (!MACH_IS_MAC)
|
||||
return -ENODEV;
|
||||
|
||||
switch (macintosh_config->ide_type) {
|
||||
case MAC_IDE_QUADRA:
|
||||
base = IDE_BASE;
|
||||
irq = IRQ_NUBUS_F;
|
||||
break;
|
||||
case MAC_IDE_PB:
|
||||
base = IDE_BASE;
|
||||
irq = IRQ_NUBUS_C;
|
||||
break;
|
||||
case MAC_IDE_BABOON:
|
||||
base = BABOON_BASE;
|
||||
d.port_ops = NULL;
|
||||
irq = IRQ_BABOON_1;
|
||||
break;
|
||||
default:
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!mem)
|
||||
return -ENODEV;
|
||||
|
||||
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||
if (!irq)
|
||||
return -ENODEV;
|
||||
|
||||
if (!devm_request_mem_region(&pdev->dev, mem->start,
|
||||
resource_size(mem), DRV_NAME)) {
|
||||
dev_err(&pdev->dev, "resources busy\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "ide: Macintosh %s IDE controller\n",
|
||||
mac_ide_name[macintosh_config->ide_type - 1]);
|
||||
|
||||
macide_setup_ports(&hw, base, irq);
|
||||
macide_setup_ports(&hw, mem->start, irq->start);
|
||||
|
||||
return ide_host_add(&d, hws, 1, NULL);
|
||||
rc = ide_host_add(&d, hws, 1, &host);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
platform_set_drvdata(pdev, host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(macide_init);
|
||||
static int mac_ide_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ide_host *host = platform_get_drvdata(pdev);
|
||||
|
||||
ide_host_remove(host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver mac_ide_driver = {
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
},
|
||||
.probe = mac_ide_probe,
|
||||
.remove = mac_ide_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(mac_ide_driver);
|
||||
|
||||
MODULE_ALIAS("platform:" DRV_NAME);
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -181,7 +181,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev)
|
||||
z->resource.name = z->name;
|
||||
r = zorro_find_parent_resource(pdev, z);
|
||||
error = request_resource(r, &z->resource);
|
||||
if (error)
|
||||
if (error && !(z->rom.er_Type & ERTF_MEMLIST))
|
||||
dev_err(&bus->dev,
|
||||
"Address space collision on device %s %pR\n",
|
||||
z->name, &z->resource);
|
||||
|
||||
Reference in New Issue
Block a user