Message ID | 20250124105309.295769-7-quic_vdadhani@quicinc.com |
---|---|
State | New |
Headers | show |
Series | Add support to load QUP SE firmware from | expand |
On Fri, Jan 24, 2025 at 04:23:07PM +0530, Viken Dadhaniya wrote: > Add provision to load firmware of Serial engine for I2C protocol from > Linux Execution Environment on running on APPS processor. > > Co-developed-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> > Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> > Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com> > --- > drivers/i2c/busses/i2c-qcom-geni.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index 7bbd478171e0..9ad3b8c9a224 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -872,8 +872,11 @@ static int geni_i2c_probe(struct platform_device *pdev) > } > proto = geni_se_read_proto(&gi2c->se); > if (proto != GENI_SE_I2C) { > - ret = dev_err_probe(dev, -ENXIO, "Invalid proto %d\n", proto); > - goto err_resources; > + ret = geni_load_se_firmware(&gi2c->se, GENI_SE_I2C); Hmm, so if the SE has been configured to e.g. SPI by the TZ, can we switch it to the I2C? > + if (ret) { > + dev_err(gi2c->se.dev, "i2c firmware load failed ret: %d\n", ret); > + goto err_resources; > + } > } > > if (desc && desc->no_dma_support) > -- > 2.34.1 >
On 1/24/2025 8:34 PM, Dmitry Baryshkov wrote: > On Fri, Jan 24, 2025 at 04:23:07PM +0530, Viken Dadhaniya wrote: >> Add provision to load firmware of Serial engine for I2C protocol from >> Linux Execution Environment on running on APPS processor. >> >> Co-developed-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> >> Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> >> Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com> >> --- >> drivers/i2c/busses/i2c-qcom-geni.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c >> index 7bbd478171e0..9ad3b8c9a224 100644 >> --- a/drivers/i2c/busses/i2c-qcom-geni.c >> +++ b/drivers/i2c/busses/i2c-qcom-geni.c >> @@ -872,8 +872,11 @@ static int geni_i2c_probe(struct platform_device *pdev) >> } >> proto = geni_se_read_proto(&gi2c->se); >> if (proto != GENI_SE_I2C) { >> - ret = dev_err_probe(dev, -ENXIO, "Invalid proto %d\n", proto); >> - goto err_resources; >> + ret = geni_load_se_firmware(&gi2c->se, GENI_SE_I2C); > > Hmm, so if the SE has been configured to e.g. SPI by the TZ, can we > switch it to the I2C? No, in the current design, TZ will not load the SE firmware. > >> + if (ret) { >> + dev_err(gi2c->se.dev, "i2c firmware load failed ret: %d\n", ret); >> + goto err_resources; >> + } >> } >> >> if (desc && desc->no_dma_support) >> -- >> 2.34.1 >> >
On 1/24/2025 9:25 PM, Dmitry Baryshkov wrote: > On Fri, 24 Jan 2025 at 17:24, Viken Dadhaniya <quic_vdadhani@quicinc.com> wrote: >> >> >> >> On 1/24/2025 8:34 PM, Dmitry Baryshkov wrote: >>> On Fri, Jan 24, 2025 at 04:23:07PM +0530, Viken Dadhaniya wrote: >>>> Add provision to load firmware of Serial engine for I2C protocol from >>>> Linux Execution Environment on running on APPS processor. >>>> >>>> Co-developed-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> >>>> Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com> >>>> Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com> >>>> --- >>>> drivers/i2c/busses/i2c-qcom-geni.c | 7 +++++-- >>>> 1 file changed, 5 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c >>>> index 7bbd478171e0..9ad3b8c9a224 100644 >>>> --- a/drivers/i2c/busses/i2c-qcom-geni.c >>>> +++ b/drivers/i2c/busses/i2c-qcom-geni.c >>>> @@ -872,8 +872,11 @@ static int geni_i2c_probe(struct platform_device *pdev) >>>> } >>>> proto = geni_se_read_proto(&gi2c->se); >>>> if (proto != GENI_SE_I2C) { >>>> - ret = dev_err_probe(dev, -ENXIO, "Invalid proto %d\n", proto); >>>> - goto err_resources; >>>> + ret = geni_load_se_firmware(&gi2c->se, GENI_SE_I2C); >>> >>> Hmm, so if the SE has been configured to e.g. SPI by the TZ, can we >>> switch it to the I2C? >> >> No, in the current design, TZ will not load the SE firmware. > > But that's what your patch is doing: if the protocol is not I2C, try > switching to I2C. > > Instead it should be 'if unconfigured, try loading I2C'. Sure, I will update it in the next patch. > >> >>> >>>> + if (ret) { >>>> + dev_err(gi2c->se.dev, "i2c firmware load failed ret: %d\n", ret); >>>> + goto err_resources; >>>> + } >>>> } >>>> >>>> if (desc && desc->no_dma_support) >>>> -- >>>> 2.34.1 >>>> >>> > > >
diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 7bbd478171e0..9ad3b8c9a224 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -872,8 +872,11 @@ static int geni_i2c_probe(struct platform_device *pdev) } proto = geni_se_read_proto(&gi2c->se); if (proto != GENI_SE_I2C) { - ret = dev_err_probe(dev, -ENXIO, "Invalid proto %d\n", proto); - goto err_resources; + ret = geni_load_se_firmware(&gi2c->se, GENI_SE_I2C); + if (ret) { + dev_err(gi2c->se.dev, "i2c firmware load failed ret: %d\n", ret); + goto err_resources; + } } if (desc && desc->no_dma_support)