Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Thu, 2013-01-17 at 13:21 +0200, Artem Bityutskiy wrote: > Probably this should also be outside of the driver, since it is not > specific to this driver. Take a look at this huge array which constantly gets updated with new chips (see git log): drivers/mtd/devices/m25p80.c static const struct spi_device_id m25p_ids[] I think this should be generalized and shared across the drivers. -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Wed, 2013-01-16 at 06:53 +1300, Tony Prisk wrote: > This patch adds support for the Wondermedia serial flash controller > found on WM8505, WM8650 and WM8850 SoCs. > > Signed-off-by: Tony Prisk > --- > v2: > Change Kconfig depends to ARCH_VT8500 as this driver can't be used on other > platforms. Sparse still complains: @@ @@ +drivers/mtd/devices/wmt_sflash.c:442:24: warning: cast removes address space of expression [sparse] +drivers/mtd/devices/wmt_sflash.c:458:17: warning: incorrect type in argument 1 (different address spaces) [sparse] +drivers/mtd/devices/wmt_sflash.c:458:17:expected void volatile [noderef] * [sparse] +drivers/mtd/devices/wmt_sflash.c:458:17:got unsigned char [usertype] * [sparse] +drivers/mtd/devices/wmt_sflash.c:465:25: warning: incorrect type in argument 1 (different address spaces) [sparse] +drivers/mtd/devices/wmt_sflash.c:465:25:expected void volatile [noderef] * [sparse] +drivers/mtd/devices/wmt_sflash.c:465:25:got unsigned char [usertype] * [sparse] Also, checkpatch.pl has a valid complaint: WARNING:CONFIG_DESCRIPTION: please write a paragraph that describes the config symbol fully #26: FILE: drivers/mtd/devices/Kconfig:131: +config MTD_WMT_SFLASH total: 0 errors, 1 warnings, 636 lines checked ... > +/* WinBond */ > +#define WB_W25X40BV 0x3013 /* 512 KB */ > +#define WB_X16A 0x3015 /* 2 MB */ > +#define WB_X32 0x3016 /* 4 MB */ > +#define WB_X64 0x3017 /* 8 MB */ > + > + > +#define SF_ID(mfr, mdl) ((mfr << 16) | mdl) The flash manufacturer IDs are not specific to this driver, and should be defined in a common header. > + > +#define FLASH_UNKNOWN0x00ff > + > +struct wmt_flash_id { > + u32 id; > + u32 size; /* Size in KB */ > +}; > + > +static struct wmt_flash_id flash_ids[] = { > + { SF_ID(MFR_SPANSION, SPAN_FL016A), 2048 }, > + { SF_ID(MFR_SPANSION, SPAN_FL064A), 8192 }, > + { SF_ID(MFR_EON,EON_25P16), 2048 }, > + { SF_ID(MFR_EON,EON_25P64), 8192 }, > + { SF_ID(MFR_EON,EON_25F40), 512 }, > + { SF_ID(MFR_EON,EON_25F16), 2048 }, > + { SF_ID(MFR_ATMEL, AT_25DF041A), 512 }, > + { SF_ID(MFR_NUMONYX,NX_25P16), 2048 }, > + { SF_ID(MFR_NUMONYX,NX_25P64), 8192 }, > + { SF_ID(MFR_FUDAN, FM_25F04), 512 }, > + { SF_ID(MFR_SST,SST_VF016B),2048 }, > + { SF_ID(MFR_MXIC, MX_L512), 64 }, > + { SF_ID(MFR_MXIC, MX_L4005A), 512 }, > + { SF_ID(MFR_MXIC, MX_L1605D), 2048 }, > + { SF_ID(MFR_MXIC, MX_L3205D), 4192 }, > + { SF_ID(MFR_MXIC, MX_L6405D), 8192 }, > + { SF_ID(MFR_MXIC, MX_L1635D), 2048 }, > + { SF_ID(MFR_MXIC, MX_L3235D), 4192 }, > + { SF_ID(MFR_MXIC, MX_L12805D),16384 }, > + { SF_ID(MFR_WINBOND,WB_W25X40BV), 512 }, > + { SF_ID(MFR_WINBOND,WB_X16A), 2048 }, > + { SF_ID(MFR_WINBOND,WB_X32),4096 }, > + { SF_ID(MFR_WINBOND,WB_X64),8192 }, > + { 0, 0 }, > +}; Probably this should also be outside of the driver, since it is not specific to this driver. > +static u32 sf_get_chip_size(struct device *dev, u32 id) > +{ > + int i; > + for (i = 0; flash_ids[i].id != 0; i++) > + if (flash_ids[i].id == id) > + return flash_ids[i].size * 1024; > + > + dev_err(dev, "Unknown flash id (%08x)\n", id); > + return 0; > +} And this. -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Tue, 2013-01-15 at 21:36 +0200, Artem Bityutskiy wrote: > On Wed, 2013-01-16 at 06:53 +1300, Tony Prisk wrote: > > This patch adds support for the Wondermedia serial flash controller > > found on WM8505, WM8650 and WM8850 SoCs. > > > > Signed-off-by: Tony Prisk > > Would please you also send a defconfig which I can use to compile-test > this? > This should be sufficient. I haven't done a defconfig for arch-vt8500 yet as multiplatform-only support has gone through in this window and any previous defconfig would now be useless. This defconfig is based on 3.8-rc3 - some features may not be available in earlier revisions. CONFIG_EXPERIMENTAL=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_ARCH_VT8500_SINGLE=y # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set CONFIG_ARM_ARCH_TIMER=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_HIGHPTE=y CONFIG_ARM_APPENDED_DTB=y CONFIG_VFP=y CONFIG_NEON=y CONFIG_NET=y CONFIG_BLK_DEV_SD=y CONFIG_NETDEVICES=y CONFIG_NET_CALXEDA_XGMAC=y CONFIG_SMSC911X=y CONFIG_STMMAC_ETH=y CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_VT8500=y CONFIG_SERIAL_VT8500_CONSOLE=y CONFIG_GPIO_VT8500=y CONFIG_GPIOLIB=y CONFIG_FB=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FB_VT8500=y CONFIG_FB_WM8505=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_VT8500=y CONFIG_USB=y CONFIG_MMC=y CONFIG_PWM=y CONFIG_PWM_VT8500=y CONFIG_MTD=y CONFIG_MTD_WMT_SFLASH=y CONFIG_DMADEVICES=y Regards Tony P -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Tue, 2013-01-15 at 21:11 +0200, Artem Bityutskiy wrote: > On Wed, 2013-01-16 at 06:45 +1300, Tony Prisk wrote: > > On Tue, 2013-01-15 at 16:55 +0200, Artem Bityutskiy wrote: > > > On Mon, 2012-12-31 at 10:00 +1300, Tony Prisk wrote: > > > > This patch adds support for the Wondermedia serial flash controller > > > > found on WM8505, WM8650 and WM8850 SoCs. > > > > > > > > Signed-off-by: Tony Prisk > > > > --- > > > > 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: > > > > > > --- before_patching.log > > > +++ after_patching.log > > > @@ @@ > > > +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] *dst [sparse] > > > +drivers/mtd/devices/wmt_sflash.c:458:31:got unsigned char [usertype] > > > * [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] *dst [sparse] > > > +drivers/mtd/devices/wmt_sflash.c:465:39:got unsigned char [usertype] > > > * [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. > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Wed, 2013-01-16 at 06:53 +1300, Tony Prisk wrote: > This patch adds support for the Wondermedia serial flash controller > found on WM8505, WM8650 and WM8850 SoCs. > > Signed-off-by: Tony Prisk Would please you also send a defconfig which I can use to compile-test this? -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Wed, 2013-01-16 at 06:45 +1300, Tony Prisk wrote: > On Tue, 2013-01-15 at 16:55 +0200, Artem Bityutskiy wrote: > > On Mon, 2012-12-31 at 10:00 +1300, Tony Prisk wrote: > > > This patch adds support for the Wondermedia serial flash controller > > > found on WM8505, WM8650 and WM8850 SoCs. > > > > > > Signed-off-by: Tony Prisk > > > --- > > > 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: > > > > --- before_patching.log > > +++ after_patching.log > > @@ @@ > > +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] *dst [sparse] > > +drivers/mtd/devices/wmt_sflash.c:458:31:got unsigned char [usertype] > > * [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] *dst [sparse] > > +drivers/mtd/devices/wmt_sflash.c:465:39:got unsigned char [usertype] > > * [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. -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Tue, 2013-01-15 at 16:55 +0200, Artem Bityutskiy wrote: > On Mon, 2012-12-31 at 10:00 +1300, Tony Prisk wrote: > > This patch adds support for the Wondermedia serial flash controller > > found on WM8505, WM8650 and WM8850 SoCs. > > > > Signed-off-by: Tony Prisk > > --- > > 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: > > --- before_patching.log > +++ after_patching.log > @@ @@ > +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] > *dst [sparse] > +drivers/mtd/devices/wmt_sflash.c:458:31:got unsigned char [usertype] > * [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] > *dst [sparse] > +drivers/mtd/devices/wmt_sflash.c:465:39:got unsigned char [usertype] > * [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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] mtd: vt8500: Add support for Wondermedia Serial Flash Controller
On Mon, 2012-12-31 at 10:00 +1300, Tony Prisk wrote: > This patch adds support for the Wondermedia serial flash controller > found on WM8505, WM8650 and WM8850 SoCs. > > Signed-off-by: Tony Prisk > --- > 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: --- before_patching.log +++ after_patching.log @@ @@ +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] *dst [sparse] +drivers/mtd/devices/wmt_sflash.c:458:31:got unsigned char [usertype] * [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] *dst [sparse] +drivers/mtd/devices/wmt_sflash.c:465:39:got unsigned char [usertype] * [sparse] -- Best Regards, Artem Bityutskiy signature.asc Description: This is a digitally signed message part