Skip to contentSkip to conversation

mtd: vt8500: Add support for Wondermedia Serial Flash Controller

PATCH Superseded Tony Prisk 2 participants 5 messages Dec 30, 2012 – Jan 15, 2013 Memory technology devices (MTD)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

PATCH v2 1/1 mtd: vt8500: Add support for Wondermedia Serial Flash Controller

This patch adds support for the Wondermedia serial flash controller found on WM8505, WM8650 and WM8850 SoCs.

---
v2: Whitespace tidyup

 drivers/mtd/devices/Kconfig      |    7 +
 drivers/mtd/devices/Makefile     |    3 +-
 drivers/mtd/devices/wmt_sflash.c |  614 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 623 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/devices/wmt_sflash.c
drivers/mtd/devices/Kconfig +7 -0
index 27f80cd..6c4bbd4 100644
@@ -128,6 +128,13 @@ config MTD_BCM47XXSFLASH
 	  registered by bcma as platform devices. This enables driver for
 	  serial flash memories (only read-only mode is implemented).
 
+config MTD_WMT_SFLASH
+	tristate "WonderMedia Serial Flash Support"
+	depends on MTD
+	help
+	  Enable this option to provide support for the Wondermedia SoC serial
+	  flash controller.
+
 config MTD_SLRAM
 	tristate "Uncached system RAM"
 	help
drivers/mtd/devices/Makefile +2 -1
index 395733a..10b8bec 100644
@@ -19,6 +19,7 @@ obj-$(CONFIG_MTD_DATAFLASH)	+= mtd_dataflash.o
 obj-$(CONFIG_MTD_M25P80)	+= m25p80.o
 obj-$(CONFIG_MTD_SPEAR_SMI)	+= spear_smi.o
 obj-$(CONFIG_MTD_SST25L)	+= sst25l.o
+obj-$(CONFIG_MTD_WMT_SFLASH)	+= wmt_sflash.o
 obj-$(CONFIG_MTD_BCM47XXSFLASH)	+= bcm47xxsflash.o
 
-CFLAGS_docg3.o			+= -I$(src)
\ No newline at end of file
+CFLAGS_docg3.o			+= -I$(src)
drivers/mtd/devices/wmt_sflash.c new file +614 -0

614 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 6 lines · Tony Prisk

This patch adds support for the Wondermedia serial flash controller found on WM8505, WM8650 and WM8850 SoCs.

---
v2: Whitespace tidyup

Hi, would you please take a look at these warings, identified by aiaiai:

Successfully built configuration "x86_64_defconfig,x86_64,", results:

after_patching.log renamed from before_patching.log +0 -0
@@ @@
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_read’:
+drivers/mtd/devices/wmt_sflash.c:425:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_sector_write’:
+drivers/mtd/devices/wmt_sflash.c:442:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
+drivers/mtd/devices/wmt_sflash.c:442:24: warning: cast removes address space of expression [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:458:31: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    got unsigned char [usertype] *<noident> [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:465:39: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    got unsigned char [usertype] *<noident> [sparse]
Signature · 2 lines
Best Regards,
Artem Bityutskiy
author
#2 lore raw
Quoted 19 lines · Artem Bityutskiy
Quoted 6 lines · Tony Prisk

This patch adds support for the Wondermedia serial flash controller found on WM8505, WM8650 and WM8850 SoCs.

---
v2: Whitespace tidyup

Hi, would you please take a look at these warings, identified by aiaiai:

Successfully built configuration "x86_64_defconfig,x86_64,", results:

after_patching.log renamed from before_patching.log +0 -0

@@ @@

after_patching.log renamed from before_patching.log +3 -0
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_read’:
+drivers/mtd/devices/wmt_sflash.c:425:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_sector_write’:

after_patching.log

Quoted 10 lines
after_patching.log renamed from before_patching.log +10 -0
+drivers/mtd/devices/wmt_sflash.c:442:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
+drivers/mtd/devices/wmt_sflash.c:442:24: warning: cast removes address space of expression [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:458:31: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    got unsigned char [usertype] *<noident> [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:465:39: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    got unsigned char [usertype] *<noident> [sparse]

Apologies - This driver shouldn't be selectable for x86_64. It is an ARM driver for an embedded device. Will fix.

Regards
Tony P

#3 lore raw
Quoted 25 lines · Tony Prisk
Quoted 24 lines · Artem Bityutskiy
Quoted 6 lines · Tony Prisk

This patch adds support for the Wondermedia serial flash controller found on WM8505, WM8650 and WM8850 SoCs.

---
v2: Whitespace tidyup

Hi, would you please take a look at these warings, identified by aiaiai:

Successfully built configuration "x86_64_defconfig,x86_64,", results:

after_patching.log renamed from before_patching.log +0 -0

@@ @@

after_patching.log renamed from before_patching.log +9 -0
+drivers/mtd/devices/wmt_sflash.c: In function ?sf_read?:
+drivers/mtd/devices/wmt_sflash.c:425:9: warning: format ?%d? expects argument of type ?int?, but argument 4 has type ?size_t? [-Wformat]
+drivers/mtd/devices/wmt_sflash.c: In function ?sf_sector_write?:
+drivers/mtd/devices/wmt_sflash.c:442:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
+drivers/mtd/devices/wmt_sflash.c:442:24: warning: cast removes address space of expression [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:458:31: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    got unsigned char [usertype] *<noident> [sparse]
Quoted 8 lines

after_patching.log

Quoted 5 lines
after_patching.log renamed from before_patching.log +4 -0
+drivers/mtd/devices/wmt_sflash.c:465:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:465:39: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    got unsigned char [usertype] *<noident> [sparse]

Apologies - This driver shouldn't be selectable for x86_64. It is an ARM driver for an embedded device. Will fix.

Note, there are also warnings when it is compiled for other platforms, not only x86_64. Take a look at them. Also note, than many warnings come from sparse, you probably just did not run it.

Signature · 9 lines
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130115/fcf878d1/attachment.sig>
author
#4 lore raw
Quoted 35 lines · Artem Bityutskiy
Quoted 25 lines · Tony Prisk
Quoted 24 lines · Artem Bityutskiy
Quoted 6 lines · Tony Prisk

This patch adds support for the Wondermedia serial flash controller found on WM8505, WM8650 and WM8850 SoCs.

---
v2: Whitespace tidyup

Hi, would you please take a look at these warings, identified by aiaiai:

Successfully built configuration "x86_64_defconfig,x86_64,", results:

after_patching.log renamed from before_patching.log +0 -0

@@ @@

after_patching.log renamed from before_patching.log +9 -0
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_read’:
+drivers/mtd/devices/wmt_sflash.c:425:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
+drivers/mtd/devices/wmt_sflash.c: In function ‘sf_sector_write’:
+drivers/mtd/devices/wmt_sflash.c:442:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
+drivers/mtd/devices/wmt_sflash.c:442:24: warning: cast removes address space of expression [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:458:31: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:458:31:    got unsigned char [usertype] *<noident> [sparse]
Quoted 8 lines

after_patching.log

Quoted 5 lines
after_patching.log renamed from before_patching.log +4 -0
+drivers/mtd/devices/wmt_sflash.c:465:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+drivers/mtd/devices/wmt_sflash.c:465:39: warning: incorrect type in argument 1 (different address spaces) [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    expected void volatile [noderef] <asn:2>*dst [sparse]
+drivers/mtd/devices/wmt_sflash.c:465:39:    got unsigned char [usertype] *<noident> [sparse]

Apologies - This driver shouldn't be selectable for x86_64. It is an ARM driver for an embedded device. Will fix.

Quoted 4 lines

Note, there are also warnings when it is compiled for other platforms, not only x86_64. Take a look at them. Also note, than many warnings come from sparse, you probably just did not run it.

I posted the patch for this problem this morning. It should only be selectable on arch-vt8500 and the new patch fixes this problem.

It incorrectly depended on MTD rather than ARCH_VT8500

Regards
Tony P