1dd453158SFrançois Tigeot /* 247ad44e8SFrançois Tigeot * Copyright (c) 2014-2015 François Tigeot 3dd453158SFrançois Tigeot * All rights reserved. 4dd453158SFrançois Tigeot * 5dd453158SFrançois Tigeot * Redistribution and use in source and binary forms, with or without 6dd453158SFrançois Tigeot * modification, are permitted provided that the following conditions 7dd453158SFrançois Tigeot * are met: 8dd453158SFrançois Tigeot * 1. Redistributions of source code must retain the above copyright 9dd453158SFrançois Tigeot * notice unmodified, this list of conditions, and the following 10dd453158SFrançois Tigeot * disclaimer. 11dd453158SFrançois Tigeot * 2. Redistributions in binary form must reproduce the above copyright 12dd453158SFrançois Tigeot * notice, this list of conditions and the following disclaimer in the 13dd453158SFrançois Tigeot * documentation and/or other materials provided with the distribution. 14dd453158SFrançois Tigeot * 15dd453158SFrançois Tigeot * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16dd453158SFrançois Tigeot * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17dd453158SFrançois Tigeot * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18dd453158SFrançois Tigeot * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19dd453158SFrançois Tigeot * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20dd453158SFrançois Tigeot * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21dd453158SFrançois Tigeot * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22dd453158SFrançois Tigeot * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23dd453158SFrançois Tigeot * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24dd453158SFrançois Tigeot * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25dd453158SFrançois Tigeot */ 26dd453158SFrançois Tigeot 27dd453158SFrançois Tigeot #ifndef _LINUX_IO_H_ 28dd453158SFrançois Tigeot #define _LINUX_IO_H_ 29dd453158SFrançois Tigeot 3047ad44e8SFrançois Tigeot #include <linux/kernel.h> 31*742b09c6Szrj #include <linux/bug.h> 328b1a6a38SFrançois Tigeot #include <asm/io.h> 338b1a6a38SFrançois Tigeot #include <asm/page.h> 34dd453158SFrançois Tigeot 35dd453158SFrançois Tigeot #if defined(writel) 36dd453158SFrançois Tigeot #undef writel 37dd453158SFrançois Tigeot #endif 38dd453158SFrançois Tigeot 39dd453158SFrançois Tigeot static inline void 4057e252bfSMichael Neumann writel(uint32_t value, volatile void *addr) 41dd453158SFrançois Tigeot { 42dd453158SFrançois Tigeot *(volatile uint32_t *)addr = value; 43dd453158SFrançois Tigeot } 44dd453158SFrançois Tigeot 4547ad44e8SFrançois Tigeot static inline int 4647ad44e8SFrançois Tigeot arch_phys_wc_add(unsigned long base, unsigned long size) 4747ad44e8SFrançois Tigeot { 4847ad44e8SFrançois Tigeot /* The DragonFly kernel is PAT-enabled, do nothing */ 4947ad44e8SFrançois Tigeot return 0; 5047ad44e8SFrançois Tigeot } 5147ad44e8SFrançois Tigeot 5247ad44e8SFrançois Tigeot static inline void 5347ad44e8SFrançois Tigeot arch_phys_wc_del(int handle) 5447ad44e8SFrançois Tigeot { 5547ad44e8SFrançois Tigeot BUG_ON(handle != 0); 5647ad44e8SFrançois Tigeot } 5747ad44e8SFrançois Tigeot 58dd453158SFrançois Tigeot #endif /* _LINUX_IO_H_ */ 59