140fef049SGabe Black /* 240fef049SGabe Black * Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 340fef049SGabe Black * Use of this source code is governed by a BSD-style license that can be 440fef049SGabe Black * found in the LICENSE file. 540fef049SGabe Black * 640fef049SGabe Black * Alternatively, this software may be distributed under the terms of the 740fef049SGabe Black * GNU General Public License ("GPL") version 2 as published by the Free 840fef049SGabe Black * Software Foundation. 940fef049SGabe Black */ 1040fef049SGabe Black 1140fef049SGabe Black #include <common.h> 12*e3491fb1SSimon Glass #include <mapmem.h> 1340fef049SGabe Black #include <physmem.h> 1465b3c6bbSTom Rini #include <linux/compiler.h> 1540fef049SGabe Black arch_phys_memset(phys_addr_t s,int c,phys_size_t n)1665b3c6bbSTom Riniphys_addr_t __weak arch_phys_memset(phys_addr_t s, int c, phys_size_t n) 1740fef049SGabe Black { 18*e3491fb1SSimon Glass void *s_ptr = map_sysmem(s, n); 1940fef049SGabe Black 2040fef049SGabe Black assert(((phys_addr_t)(uintptr_t)s) == s); 2140fef049SGabe Black assert(((phys_addr_t)(uintptr_t)(s + n)) == s + n); 22*e3491fb1SSimon Glass 2340fef049SGabe Black return (phys_addr_t)(uintptr_t)memset(s_ptr, c, n); 2440fef049SGabe Black } 25