Commit graph

7 commits

Author SHA1 Message Date
Rafał Miłecki ccc38234fd mtd: bcm47xxsflash: support reading flash out of mapping window
For reading flash content we use MMIO but it's possible to read only
first 16 MiB this way. It's simply an arch design/limitation.
To support flash sizes bigger than 16 MiB implement indirect access
using ChipCommon registers.
This has been tested using MX25L25635F.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2017-02-08 15:07:59 -08:00
Brian Norris 5651d6aaf4 mtd: bcm47xxsflash: use ioremap_cache() instead of KSEG0ADDR()
Using KSEG0ADDR makes code highly MIPS dependent and not portable.
Thanks to the fix a68f376 ("MIPS: io.h: Define `ioremap_cache'") we can
use ioremap_cache which is generic and supported on MIPS as well now.

KSEG0ADDR was translating 0x1c000000 into 0x9c000000. With ioremap_cache
we use MIPS's __ioremap (and then remap_area_pages). This results in
different address (e.g. 0xc0080000) but it still should be cached as
expected and it was successfully tested with BCM47186B0.

Other than that drivers/bcma/driver_chipcommon_sflash.c nicely setups a
struct resource for access window, but we wren't using it. Use it now
and drop duplicated info.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-04-04 00:07:57 -07:00
Rafał Miłecki 265dfbd9ae mtd: bcm47xxsflash: implement ChipCommon R/W ops
They are needed for erasing/writing. Use a magic pointers and small
functions to prepare code for adding other buses support in the future
(like SSB).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-08-05 18:20:32 +01:00
Rafał Miłecki a6fb35d379 mtd: bcm47xxsflash: define opcodes
We need them to add erase/write support. This may duplicate some defines
with bcma and/or ssb code, but it makes more sense to keep that in
bcm47xxsflash which is supposed to work with both buses.
Duplicated defines will be removed from ssb/bcma.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-04-05 13:14:17 +01:00
Rafał Miłecki 1f816bc729 mtd: bcm47xxsflash: store info about flash type
It's going to be needed for erase and write operations, they differ
between Atmel and ST flashes.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-04-05 13:14:14 +01:00
Rafał Miłecki 41c81536ea mtd: bcm47xxsflash: keep a reference to the BCMA
To implement erase and write support we need to "talk" with ChipCommon
BCMA core which serial flash it attached to.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-04-05 13:14:05 +01:00
Rafał Miłecki a2f74a7dac mtd: bcm47xxsflash: add own struct for abstrating bus type
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2013-02-04 09:26:30 +02:00