xref: /OK3568_Linux_fs/u-boot/lib/physmem.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
3*4882a593Smuzhiyun  * Use of this source code is governed by a BSD-style license that can be
4*4882a593Smuzhiyun  * found in the LICENSE file.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Alternatively, this software may be distributed under the terms of the
7*4882a593Smuzhiyun  * GNU General Public License ("GPL") version 2 as published by the Free
8*4882a593Smuzhiyun  * Software Foundation.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <common.h>
12*4882a593Smuzhiyun #include <physmem.h>
13*4882a593Smuzhiyun #include <linux/compiler.h>
14*4882a593Smuzhiyun 
arch_phys_memset(phys_addr_t s,int c,phys_size_t n)15*4882a593Smuzhiyun phys_addr_t __weak arch_phys_memset(phys_addr_t s, int c, phys_size_t n)
16*4882a593Smuzhiyun {
17*4882a593Smuzhiyun 	void *s_ptr = (void *)(uintptr_t)s;
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun 	assert(((phys_addr_t)(uintptr_t)s) == s);
20*4882a593Smuzhiyun 	assert(((phys_addr_t)(uintptr_t)(s + n)) == s + n);
21*4882a593Smuzhiyun 	return (phys_addr_t)(uintptr_t)memset(s_ptr, c, n);
22*4882a593Smuzhiyun }
23