On 04/09/2019 02:20 PM, Sergei Shtylyov wrote: > [...] >>>>>> + ret = rpc_spi_set_freq(rpc, desc->mem->spi->max_speed_hz); >>>>>> + if (ret) >>>>>> + return ret; >>>>>> + >>>>>> + rpc_spi_mem_set_prep_op_cfg(desc->mem->spi, >>>>>> + &desc->info.op_tmpl, &offs, &len); >>>>>> + >>>>>> + regmap_update_bits(rpc->regmap, RPC_CMNCR, RPC_CMNCR_MD, 0); >>>>>> + regmap_write(rpc->regmap, RPC_DRCR, RPC_DRCR_RBURST(32) | >>>>>> + RPC_DRCR_RBE); >>>>>> + >>>>>> + regmap_write(rpc->regmap, RPC_DRCMR, rpc->cmd); >>>>>> + regmap_write(rpc->regmap, RPC_DREAR, RPC_DREAR_EAC(1)); >>>>> >>>>> So you're not even trying to support flashes larger than the >>> read dirmap? >>>>> Now I don't think it's acceptable (and I have rewritten this code >>> internally). >>>> >>>> what about the size comes form mtd->size ? >>> >>> I'm not talking about size here; we should use the full address. >>> I'm attaching >>> my patch... >> >> okay,got it! >> what about just >> - regmap_write(rpc->mfd->regmap, RPC_DREAR, RPC_DREAR_EAC(1)); >> + regmap_write(rpc->mfd->regmap, RPC_DREAR, >> + RPC_DREAR_EAV(offs >> 25) | RPC_DREAR_EAC(1)); >> >> because only > 64MByte size make RPC_DREAR_EAV() work. > > Seems OK now, after Boris' reply. Well, actually not. The 'len' check in the beginning is oversimplified. Attached is the patch fixing up the dirmap read path (and making it handle flashes > 64 MiB as well)... >> thanks & best regards, >> Mason > > [...] MBR, Sergei