| * Copyright (c) 2014 Google, Inc |
| * From Coreboot src/lib/ramtest.c |
| * SPDX-License-Identifier: GPL-2.0 |
| static void write_phys(unsigned long addr, u32 value) |
| : "r" (addr), "r" (value) /* inputs */ |
| static u32 read_phys(unsigned long addr) |
| static void phys_memory_barrier(void) |
| void quick_ram_check(void) |
| backup = read_phys(CONFIG_RAMBASE); |
| write_phys(CONFIG_RAMBASE, 0x55555555); |
| if (read_phys(CONFIG_RAMBASE) != 0x55555555) |
| write_phys(CONFIG_RAMBASE, 0xaaaaaaaa); |
| if (read_phys(CONFIG_RAMBASE) != 0xaaaaaaaa) |
| write_phys(CONFIG_RAMBASE, 0x00000000); |
| if (read_phys(CONFIG_RAMBASE) != 0x00000000) |
| write_phys(CONFIG_RAMBASE, 0xffffffff); |
| if (read_phys(CONFIG_RAMBASE) != 0xffffffff) |
| write_phys(CONFIG_RAMBASE, backup); |
| post_code(POST_RAM_FAILURE); |
| panic("RAM INIT FAILURE!\n"); |