1 /* 2 * Copyright (c) 2014 Qualcomm Atheros, Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 #include <linux/firmware.h> 17 #include <linux/module.h> 18 #include <linux/crc32.h> 19 #include "wil6210.h" 20 #include "fw.h" 21 22 MODULE_FIRMWARE(WIL_FW_NAME); 23 24 /* target operations */ 25 /* register read */ 26 #define R(a) ioread32(wil->csr + HOSTADDR(a)) 27 /* register write. wmb() to make sure it is completed */ 28 #define W(a, v) do { iowrite32(v, wil->csr + HOSTADDR(a)); wmb(); } while (0) 29 /* register set = read, OR, write */ 30 #define S(a, v) W(a, R(a) | v) 31 /* register clear = read, AND with inverted, write */ 32 #define C(a, v) W(a, R(a) & ~v) 33 34 static 35 void wil_memset_toio_32(volatile void __iomem *dst, u32 val, 36 size_t count) 37 { 38 volatile u32 __iomem *d = dst; 39 40 for (count += 4; count > 4; count -= 4) 41 __raw_writel(val, d++); 42 } 43 44 #include "fw_inc.c" 45