mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] arch: arm: mach-imx: print HAB ROM code version
@ 2021-03-11 17:07 Denis Osterland-Heim
  2021-03-12 10:21 ` Rouven Czerwinski
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Osterland-Heim @ 2021-03-11 17:07 UTC (permalink / raw)
  To: barebox

From: Denis Osterland-Heim <Denis.Osterland@diehl.com>

Add the two missing function pointers according to HAB4_API.pdf
from cst-3.1.0 and print the version of ROM code.

Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
---
 drivers/hab/habv4.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index c2acb8136..f30e5d68c 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -161,6 +161,7 @@ struct hab_header {
 uint8_t par;
 } __packed;

+typedef void (*hab_image_entry_fn)(void);
 typedef enum hab_status hab_loader_callback_fn(void **start, uint32_t *bytes, const void *boot_data);

 struct habv4_rvt {
@@ -175,6 +176,8 @@ struct habv4_rvt {
 enum hab_status (*report_event)(enum hab_status status, uint32_t index, void *event, uint32_t *bytes);
 enum hab_status (*report_status)(enum hab_config *config, enum hab_state *state);
 void (*failsafe)(void);
+hab_image_entry_fn (*authenticate_image_no_dcd)(uint8_t cid, ptrdiff_t ivt_offset, void **start, size_t *bytes, hab_loader_callback_fn loader);
+uint32_t (*get_version)(void);
 } __packed;

 #define FSL_SIP_HAB             0xC2000007
@@ -528,6 +531,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
 uint8_t *data;
 uint32_t len;
 int i;
+uint32_t version;
 enum hab_status status;
 enum hab_config config = 0x0;
 enum hab_state state = 0x0;
@@ -537,6 +541,9 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
 return -EINVAL;
 }

+version = rvt->get_version();
+pr_info("version: %u.%u.%u\n", (version >> 16), ((version >> 8) & 0xff), (version & 0xff));
+
 status = rvt->report_status(&config, &state);
 pr_info("Status: %s (0x%02x)\n", habv4_get_status_str(status), status);
 pr_info("Config: %s (0x%02x)\n", habv4_get_config_str(config), config);
--
2.30.2

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315

________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.

- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter:

https://www.diehl.com/group/de/transparenz-und-informationspflichten/

The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.

- For general information on data protection and your respective rights please visit:

https://www.diehl.com/group/en/transparency-and-information-obligations/



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch: arm: mach-imx: print HAB ROM code version
  2021-03-11 17:07 [PATCH] arch: arm: mach-imx: print HAB ROM code version Denis Osterland-Heim
@ 2021-03-12 10:21 ` Rouven Czerwinski
  2021-03-12 11:33   ` Denis Osterland-Heim
  0 siblings, 1 reply; 3+ messages in thread
From: Rouven Czerwinski @ 2021-03-12 10:21 UTC (permalink / raw)
  To: Denis Osterland-Heim, barebox

Hi Denis,

On Thu, 2021-03-11 at 17:07 +0000, Denis Osterland-Heim wrote:
> From: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> 
> Add the two missing function pointers according to HAB4_API.pdf
> from cst-3.1.0 and print the version of ROM code.
> 
> Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> ---
>  drivers/hab/habv4.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
> index c2acb8136..f30e5d68c 100644
> --- a/drivers/hab/habv4.c
> +++ b/drivers/hab/habv4.c
> @@ -161,6 +161,7 @@ struct hab_header {
>  uint8_t par;
>  } __packed;
> 
> +typedef void (*hab_image_entry_fn)(void);
>  typedef enum hab_status hab_loader_callback_fn(void **start, uint32_t *bytes, const void *boot_data);
> 
>  struct habv4_rvt {
> @@ -175,6 +176,8 @@ struct habv4_rvt {
>  enum hab_status (*report_event)(enum hab_status status, uint32_t index, void *event, uint32_t *bytes);
>  enum hab_status (*report_status)(enum hab_config *config, enum hab_state *state);
>  void (*failsafe)(void);
> +hab_image_entry_fn (*authenticate_image_no_dcd)(uint8_t cid, ptrdiff_t ivt_offset, void **start, size_t *bytes, hab_loader_callback_fn loader);
> +uint32_t (*get_version)(void);
>  } __packed;
> 
>  #define FSL_SIP_HAB             0xC2000007
> @@ -528,6 +531,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
>  uint8_t *data;
>  uint32_t len;
>  int i;
> +uint32_t version;
>  enum hab_status status;
>  enum hab_config config = 0x0;
>  enum hab_state state = 0x0;
> @@ -537,6 +541,9 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
>  return -EINVAL;
>  }
> 
> +version = rvt->get_version();

This unconditional call will break HAB on i.MX8MQ where it isn't
implemented in the RVT, I don't know if the call is even routed in the
downstream TF-A.

Aside from this your mailer/mailserver is mangling the patches, if it
is the mailer, maybe you can switch to git-send-email, see
https://git-send-email.io

> +pr_info("version: %u.%u.%u\n", (version >> 16), ((version >> 8) & 0xff), (version & 0xff));
> +
>  status = rvt->report_status(&config, &state);
>  pr_info("Status: %s (0x%02x)\n", habv4_get_status_str(status), status);
>  pr_info("Config: %s (0x%02x)\n", habv4_get_config_str(config), config);
> --
> 2.30.2

Regards,
Rouven Czerwinski


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arch: arm: mach-imx: print HAB ROM code version
  2021-03-12 10:21 ` Rouven Czerwinski
@ 2021-03-12 11:33   ` Denis Osterland-Heim
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Osterland-Heim @ 2021-03-12 11:33 UTC (permalink / raw)
  To: r.czerwinski, barebox

[-- Attachment #1: Type: text/plain, Size: 4247 bytes --]

Hi Rouven,

I am using git send-email, but the MS-Exchange server "improves" the messages.
In my outbox on the server (OWA) they look good and do not have the footer.

Please find original mboxes attached.
Michael Olbrich gave me the tip, that an attached mbox is as easy for him as inline.
Hopefully this is true for Sasha, too.

Regards, Denis

Am Freitag, den 12.03.2021, 11:21 +0100 schrieb Rouven Czerwinski:
> Hi Denis,
>
> On Thu, 2021-03-11 at 17:07 +0000, Denis Osterland-Heim wrote:
> > From: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> >
> > Add the two missing function pointers according to HAB4_API.pdf
> > from cst-3.1.0 and print the version of ROM code.
> >
> > Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> > ---
> >  drivers/hab/habv4.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
> > index c2acb8136..f30e5d68c 100644
> > --- a/drivers/hab/habv4.c
> > +++ b/drivers/hab/habv4.c
> > @@ -161,6 +161,7 @@ struct hab_header {
> >  uint8_t par;
> >  } __packed;
> >
> > +typedef void (*hab_image_entry_fn)(void);
> >  typedef enum hab_status hab_loader_callback_fn(void **start, uint32_t *bytes, const void *boot_data);
> >
> >  struct habv4_rvt {
> > @@ -175,6 +176,8 @@ struct habv4_rvt {
> >  enum hab_status (*report_event)(enum hab_status status, uint32_t index, void *event, uint32_t *bytes);
> >  enum hab_status (*report_status)(enum hab_config *config, enum hab_state *state);
> >  void (*failsafe)(void);
> > +hab_image_entry_fn (*authenticate_image_no_dcd)(uint8_t cid, ptrdiff_t ivt_offset, void **start, size_t *bytes, hab_loader_callback_fn loader);
> > +uint32_t (*get_version)(void);
> >  } __packed;
> >
> >  #define FSL_SIP_HAB             0xC2000007
> > @@ -528,6 +531,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
> >  uint8_t *data;
> >  uint32_t len;
> >  int i;
> > +uint32_t version;
> >  enum hab_status status;
> >  enum hab_config config = 0x0;
> >  enum hab_state state = 0x0;
> > @@ -537,6 +541,9 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
> >  return -EINVAL;
> >  }
> >
> > +version = rvt->get_version();
>
> This unconditional call will break HAB on i.MX8MQ where it isn't
> implemented in the RVT, I don't know if the call is even routed in the
> downstream TF-A.
>
> Aside from this your mailer/mailserver is mangling the patches, if it
> is the mailer, maybe you can switch to git-send-email, see
> https://git-send-email.io
>
> > +pr_info("version: %u.%u.%u\n", (version >> 16), ((version >> 8) & 0xff), (version & 0xff));
> > +
> >  status = rvt->report_status(&config, &state);
> >  pr_info("Status: %s (0x%02x)\n", habv4_get_status_str(status), status);
> >  pr_info("Config: %s (0x%02x)\n", habv4_get_config_str(config), config);
> > --
> > 2.30.2
>
> Regards,
> Rouven Czerwinski
Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315

________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.

- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter:

https://www.diehl.com/group/de/transparenz-und-informationspflichten/

The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.

- For general information on data protection and your respective rights please visit:

https://www.diehl.com/group/en/transparency-and-information-obligations/



[-- Attachment #2: 1.mbox --]
[-- Type: application/mbox, Size: 2436 bytes --]

[-- Attachment #3: 2.mbox --]
[-- Type: application/mbox, Size: 3510 bytes --]

[-- Attachment #4: 3.mbox --]
[-- Type: application/mbox, Size: 1594 bytes --]

[-- Attachment #5: 4.mbox --]
[-- Type: application/mbox, Size: 3620 bytes --]

[-- Attachment #6: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-12 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 17:07 [PATCH] arch: arm: mach-imx: print HAB ROM code version Denis Osterland-Heim
2021-03-12 10:21 ` Rouven Czerwinski
2021-03-12 11:33   ` Denis Osterland-Heim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox