Lines Matching +full:partition +full:-

1 // SPDX-License-Identifier: GPL-2.0-only
30 * a chip-specific register address, so look it up in the registers in wl1251_translate_reg_addr()
36 return -EINVAL; in wl1251_translate_reg_addr()
41 return addr - wl->physical_reg_addr + wl->virtual_reg_addr; in wl1251_translate_reg_addr()
46 return addr - wl->physical_mem_addr + wl->virtual_mem_addr; in wl1251_translate_mem_addr()
55 wl->if_ops->read(wl, physical, buf, len); in wl1251_mem_read()
64 wl->if_ops->write(wl, physical, buf, len); in wl1251_mem_write()
89 * There are two VIRTUAL partitions (the memory partition and the
90 * registers partition), which are mapped to two different areas of the
93 * memory partition comes before the register partition, but the opposite is
100 * ...+----+--> mem_start
104 * 0x00000000 <--+----+... ...+----+--> mem_start + mem_size
108 * part_size <--+----+... | | {unused area)
112 * + <--+----+... ...+----+--> reg_start
116 * ...+----+--> reg_start + reg_size
124 struct wl1251_partition_set *partition; in wl1251_set_partition() local
126 partition = kmalloc(sizeof(*partition), GFP_KERNEL); in wl1251_set_partition()
127 if (!partition) { in wl1251_set_partition()
128 wl1251_error("can not allocate partition buffer"); in wl1251_set_partition()
141 " address range. Truncating partition[0]."); in wl1251_set_partition()
142 mem_size = HW_ACCESS_MEMORY_MAX_RANGE - reg_size; in wl1251_set_partition()
151 /* Guarantee that the memory partition doesn't overlap the in wl1251_set_partition()
152 * registers partition */ in wl1251_set_partition()
153 wl1251_debug(DEBUG_SPI, "End of partition[0] is " in wl1251_set_partition()
154 "overlapping partition[1]. Adjusted."); in wl1251_set_partition()
155 mem_size = reg_start - mem_start; in wl1251_set_partition()
162 /* Guarantee that the register partition doesn't overlap the in wl1251_set_partition()
163 * memory partition */ in wl1251_set_partition()
164 wl1251_debug(DEBUG_SPI, "End of partition[1] is" in wl1251_set_partition()
165 " overlapping partition[0]. Adjusted."); in wl1251_set_partition()
166 reg_size = mem_start - reg_start; in wl1251_set_partition()
173 partition->mem.start = mem_start; in wl1251_set_partition()
174 partition->mem.size = mem_size; in wl1251_set_partition()
175 partition->reg.start = reg_start; in wl1251_set_partition()
176 partition->reg.size = reg_size; in wl1251_set_partition()
178 wl->physical_mem_addr = mem_start; in wl1251_set_partition()
179 wl->physical_reg_addr = reg_start; in wl1251_set_partition()
181 wl->virtual_mem_addr = 0; in wl1251_set_partition()
182 wl->virtual_reg_addr = mem_size; in wl1251_set_partition()
184 wl->if_ops->write(wl, HW_ACCESS_PART0_SIZE_ADDR, partition, in wl1251_set_partition()
185 sizeof(*partition)); in wl1251_set_partition()
187 kfree(partition); in wl1251_set_partition()