* RE: [PATCH v9 6/6] thunderbolt: Add support for ASMedia image format
@ 2022-09-06 10:11 Szuying Chen
2022-09-06 10:20 ` Mika Westerberg
0 siblings, 1 reply; 2+ messages in thread
From: Szuying Chen @ 2022-09-06 10:11 UTC (permalink / raw)
To: mika.westerberg, YehezkelShB
Cc: gregkh, mario.limonciello, andreas.noever, michael.jamet,
linux-usb, linux-kernel, Yd_Tseng, Chloe_Chen, Richard_Hsu
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!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v9 6/6] thunderbolt: Add support for ASMedia image format
2022-09-06 10:11 [PATCH v9 6/6] thunderbolt: Add support for ASMedia image format Szuying Chen
@ 2022-09-06 10:20 ` Mika Westerberg
0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2022-09-06 10:20 UTC (permalink / raw)
To: Szuying Chen
Cc: YehezkelShB, gregkh, mario.limonciello, andreas.noever,
michael.jamet, linux-usb, linux-kernel, Yd_Tseng, Chloe_Chen,
Richard_Hsu
On Tue, Sep 06, 2022 at 06:11:28PM +0800, Szuying Chen wrote:
> 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
Heh, that one was clearly a copy paste error ;-)
I will fix it up when applying. Thanks for checking.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-06 10:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 10:11 [PATCH v9 6/6] thunderbolt: Add support for ASMedia image format Szuying Chen
2022-09-06 10:20 ` Mika Westerberg
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®