Lines Matching +full:- +full:sram
1 // SPDX-License-Identifier: GPL-2.0
4 * flexcop-sram.c - functions for controlling the SRAM
17 switch (fc->rev) { in flexcop_sram_init()
26 return -EINVAL; in flexcop_sram_init()
35 v = fc->read_ibi_reg(fc, sram_dest_reg_714); in flexcop_sram_set_dest()
37 if (fc->rev != FLEXCOP_III && target == FC_SRAM_DEST_TARGET_FC3_CA) { in flexcop_sram_set_dest()
38 err("SRAM destination target to available on FlexCopII(b)\n"); in flexcop_sram_set_dest()
39 return -EINVAL; in flexcop_sram_set_dest()
41 deb_sram("sram dest: %x target: %x\n", dest, target); in flexcop_sram_set_dest()
52 fc->write_ibi_reg(fc,sram_dest_reg_714,v); in flexcop_sram_set_dest()
67 flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); in flexcop_sram_ctrl()
71 fc->write_ibi_reg(fc,sram_dest_reg_714,v); in flexcop_sram_ctrl()
88 retries--;
92 printk("%s: SRAM timeout\n", __func__);
113 retries--;
117 printk("%s: SRAM timeout\n", __func__);
125 retries--;
129 printk("%s: SRAM timeout\n", __func__);
146 if (adapter->dw_sram_type == 0x20000) {
150 if (adapter->dw_sram_type == 0x00000) {
164 if (adapter->dw_sram_type == 0x20000) {
168 if (adapter->dw_sram_type == 0x00000) {
185 if ((addr >> 0x0f) != ((addr + len - 1) >> 0x0f)) {
186 length = (((addr >> 0x0f) + 1) << 0x0f) - addr;
192 len = len - length;
205 if ((addr >> 0x0f) != ((addr + len - 1) >> 0x0f)) {
206 length = (((addr >> 0x0f) + 1) << 0x0f) - addr;
212 len = len - length;
230 adapter->dw_sram_type = tmp & 0x30000;
231 ddprintk("%s: dw_sram_type = %x\n", __func__, adapter->dw_sram_type);
233 adapter->dw_sram_type = 0x10000;
234 ddprintk("%s: dw_sram_type = %x\n", __func__, adapter->dw_sram_type);
284 if (adapter->dw_sram_type == 0x10000)
286 if (adapter->dw_sram_type == 0x00000)
288 if (adapter->dw_sram_type == 0x20000)
293 /* FlexcopII can work with 32K, 64K or 128K of external SRAM memory.
294 - for 128K there are 4x32K chips at bank 0,1,2,3.
295 - for 64K there are 2x32K chips at bank 1,2.
296 - for 32K there is one 32K chip at bank 0.
299 by bits 28-29 of the 0x700 register.
301 bank 0 covers addresses 0x00000-0x07fff
302 bank 1 covers addresses 0x08000-0x0ffff
303 bank 2 covers addresses 0x10000-0x17fff
304 bank 3 covers addresses 0x18000-0x1ffff */
309 r208 = fc->read_ibi_reg(fc, ctrl_208);
310 fc->write_ibi_reg(fc, ctrl_208, ibi_zero);
312 r71c_0 = fc->read_ibi_reg(fc, wan_ctrl_reg_71c);
318 // check for internal SRAM ???
319 tmp3--;
324 dprintk("%s: sram size = 32K\n", __func__);
332 dprintk("%s: sram size = 128K\n", __func__);
340 dprintk("%s: sram size = 64K\n", __func__);
348 dprintk("%s: sram size = 32K\n", __func__);
355 dprintk("%s: SRAM detection failed. Set to 32K \n", __func__);