linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Hauke Mehrtens <hauke@hauke-m.de>
Subject: Re: [PATCH] ssb: add struct for serial flash
Date: Mon, 17 Jun 2013 20:38:21 +0100	[thread overview]
Message-ID: <201306172038.21642.florian@openwrt.org> (raw)
In-Reply-To: <1371491780-23412-1-git-send-email-zajec5@gmail.com>

Hello Rafal,

Le lundi 17 juin 2013 18:56:20, Rafał Miłecki a écrit :
> This data allow writing for example MTD driver.

Your commit message could probably have some more information, by looking at 
the patch, it is not entirely clear to me what this does, especially as sflash 
is just a write only structure?

> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>  drivers/ssb/driver_chipcommon_sflash.c |    7 +++++++
>  include/linux/ssb/ssb_driver_mips.h    |   15 +++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/drivers/ssb/driver_chipcommon_sflash.c
> b/drivers/ssb/driver_chipcommon_sflash.c index 1b9e770..205f1c4 100644
> --- a/drivers/ssb/driver_chipcommon_sflash.c
> +++ b/drivers/ssb/driver_chipcommon_sflash.c
> @@ -73,6 +73,7 @@ static void ssb_sflash_cmd(struct ssb_chipcommon *cc, u32
> opcode) /* Initialize serial flash access */
>  int ssb_sflash_init(struct ssb_chipcommon *cc)
>  {
> +	struct ssb_sflash *sflash = &cc->dev->bus->mipscore.sflash;
>  	const struct ssb_sflash_tbl_e *e;
>  	u32 id, id2;
> 
> @@ -131,6 +132,12 @@ int ssb_sflash_init(struct ssb_chipcommon *cc)
>  		return -ENOTSUPP;
>  	}
> 
> +	sflash->window = SSB_FLASH2;
> +	sflash->blocksize = e->blocksize;
> +	sflash->numblocks = e->numblocks;
> +	sflash->size = sflash->blocksize * sflash->numblocks;
> +	sflash->present = true;
> +
>  	pr_info("Found %s serial flash (blocksize: 0x%X, blocks: %d)\n",
>  		e->name, e->blocksize, e->numblocks);
> 
> diff --git a/include/linux/ssb/ssb_driver_mips.h
> b/include/linux/ssb/ssb_driver_mips.h index afe79d4..6535e47 100644
> --- a/include/linux/ssb/ssb_driver_mips.h
> +++ b/include/linux/ssb/ssb_driver_mips.h
> @@ -20,6 +20,18 @@ struct ssb_pflash {
>  	u32 window_size;
>  };
> 
> +#ifdef CONFIG_SSB_SFLASH
> +struct ssb_sflash {
> +	bool present;
> +	u32 window;
> +	u32 blocksize;
> +	u16 numblocks;
> +	u32 size;
> +
> +	void *priv;
> +};
> +#endif
> +
>  struct ssb_mipscore {
>  	struct ssb_device *dev;
> 
> @@ -27,6 +39,9 @@ struct ssb_mipscore {
>  	struct ssb_serial_port serial_ports[4];
> 
>  	struct ssb_pflash pflash;
> +#ifdef CONFIG_SSB_SFLASH
> +	struct ssb_sflash sflash;
> +#endif
>  };
> 
>  extern void ssb_mipscore_init(struct ssb_mipscore *mcore);

-- 
Florian

  reply	other threads:[~2013-06-17 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 17:56 [PATCH] ssb: add struct for serial flash Rafał Miłecki
2013-06-17 19:38 ` Florian Fainelli [this message]
2013-06-17 19:46   ` Rafał Miłecki
2013-06-17 20:33     ` Rafał Miłecki
2013-06-17 20:38 ` Rafał Miłecki
2013-06-17 20:40   ` Rafał Miłecki
2013-06-17 21:09   ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201306172038.21642.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=hauke@hauke-m.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).