mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Szuying Chen <chensiying21@gmail.com>
To: mika.westerberg@linux.intel.com, YehezkelShB@gmail.com
Cc: gregkh@linuxfoundation.org, mario.limonciello@amd.com,
	andreas.noever@gmail.com, michael.jamet@intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yd_Tseng@asmedia.com.tw, Chloe_Chen@asmedia.com.tw,
	Richard_Hsu@asmedia.com.tw
Subject: RE: [PATCH v9 6/6] thunderbolt: Add support for ASMedia image format
Date: Tue,  6 Sep 2022 18:11:28 +0800	[thread overview]
Message-ID: <20220906101128.6504-1-chensiying21@gmail.com> (raw)

From: Szuying Chen <Chloe_Chen@asmedia.com.tw>

Hi,

>  
> +static int asmedia_switch_nvm_version(struct tb_nvm *nvm) {
> +	struct tb_switch *sw = tb_to_switch(nvm->dev);
> +	u32 val;
> +	int ret;
> +
> +	ret = tb_switch_nvm_read(sw, ASMEDIA_NVM_VERSION, &val, sizeof(val));
> +	if (ret)
> +		return ret;
> +
> +	nvm->major = (val << 16) & 0xff0000;
> +	nvm->minor |= val & 0x00ff00;

	nvm->major

> +	nvm->major |= (val >> 16) & 0x0000ff;
> +
> +	ret = tb_switch_nvm_read(sw, ASMEDIA_NVM_DATE, &val, sizeof(val));
> +	if (ret)
> +		return ret;
> +
> +	nvm->minor = (val << 16) & 0xff0000;
> +	nvm->minor |= val & 0x00ff00;
> +	nvm->minor |= (val >> 16) & 0x0000ff;
> +
> +	/* ASMedia NVM size is fixed to 512k */
> +	nvm->active_size = SZ_512K;
> +
> +	return 0;
> +}
> +
> +static const struct tb_nvm_vendor_ops asmedia_switch_nvm_ops = {
> +	.read_version = asmedia_switch_nvm_version, };
> +
>  /* Router vendor NVM support table */
>  static const struct tb_nvm_vendor switch_nvm_vendors[] = {
> +	{ 0x174c, &asmedia_switch_nvm_ops },
>  	{ PCI_VENDOR_ID_INTEL, &intel_switch_nvm_ops },
>  	{ 0x8087, &intel_switch_nvm_ops },
>  };
> --

Thanks!


             reply	other threads:[~2022-09-06 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 10:11 Szuying Chen [this message]
2022-09-06 10:20 ` Mika Westerberg

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=20220906101128.6504-1-chensiying21@gmail.com \
    --to=chensiying21@gmail.com \
    --cc=Chloe_Chen@asmedia.com.tw \
    --cc=Richard_Hsu@asmedia.com.tw \
    --cc=Yd_Tseng@asmedia.com.tw \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.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

all inboxes | Powered by JetHome®