Save sram context after changing MPU, DSP or core clocks
[linux-ginger.git] / drivers / net / wireless / wl12xx / wl1251_io.h
blobb89d2ac62efb04275e0e5f49073a31e3082d16c6
1 /*
2 * This file is part of wl12xx
4 * Copyright (C) 2008 Nokia Corporation
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
21 #ifndef __WL1251_IO_H__
22 #define __WL1251_IO_H__
24 #include "wl1251.h"
26 #define HW_ACCESS_MEMORY_MAX_RANGE 0x1FFC0
28 #define HW_ACCESS_PART0_SIZE_ADDR 0x1FFC0
29 #define HW_ACCESS_PART0_START_ADDR 0x1FFC4
30 #define HW_ACCESS_PART1_SIZE_ADDR 0x1FFC8
31 #define HW_ACCESS_PART1_START_ADDR 0x1FFCC
33 #define HW_ACCESS_REGISTER_SIZE 4
35 #define HW_ACCESS_PRAM_MAX_RANGE 0x3c000
37 static inline u32 wl1251_read32(struct wl1251 *wl, int addr)
39 u32 response;
41 wl->if_ops->read(wl, addr, &response, sizeof(u32));
43 return response;
46 static inline void wl1251_write32(struct wl1251 *wl, int addr, u32 val)
48 wl->if_ops->write(wl, addr, &val, sizeof(u32));
51 /* Memory target IO, address is translated to partition 0 */
52 void wl1251_mem_read(struct wl1251 *wl, int addr, void *buf, size_t len);
53 void wl1251_mem_write(struct wl1251 *wl, int addr, void *buf, size_t len);
54 u32 wl1251_mem_read32(struct wl1251 *wl, int addr);
55 void wl1251_mem_write32(struct wl1251 *wl, int addr, u32 val);
56 /* Registers IO */
57 u32 wl1251_reg_read32(struct wl1251 *wl, int addr);
58 void wl1251_reg_write32(struct wl1251 *wl, int addr, u32 val);
60 void wl1251_set_partition(struct wl1251 *wl,
61 u32 part_start, u32 part_size,
62 u32 reg_start, u32 reg_size);
64 #endif