All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
@ 2016-04-29  1:56 Peng Fan
  2016-05-02 23:41 ` Tom Rini
  2016-05-10  9:30 ` Peng Fan
  0 siblings, 2 replies; 7+ messages in thread
From: Peng Fan @ 2016-04-29  1:56 UTC (permalink / raw)
  To: u-boot

This commit "2bb014820c49a63902103bac710bc86b5772e843"
do some clean up to use the code in lib/time.c.
But usec2ticks is still being used by security related job ring code.
Bring back the function to avoid build break.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/imx-common/timer.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
index 92c7218..bde24af 100644
--- a/arch/arm/imx-common/timer.c
+++ b/arch/arm/imx-common/timer.c
@@ -124,3 +124,20 @@ ulong get_tbclk(void)
 {
 	return gpt_get_clk();
 }
+
+/*
+ * This function is intended for SHORT delays only.
+ * It will overflow at around 10 seconds @ 400MHz,
+ * or 20 seconds @ 200MHz.
+ */
+unsigned long usec2ticks(unsigned long usec)
+{
+	ulong ticks;
+
+	if (usec < 1000)
+		ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
+	else
+		ticks = ((usec / 10) * (get_tbclk() / 100000));
+
+	return ticks;
+}
-- 
2.6.2

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-04-29  1:56 [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks Peng Fan
@ 2016-05-02 23:41 ` Tom Rini
  2016-05-03  1:17   ` Peng Fan
  2016-05-10  9:30 ` Peng Fan
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Rini @ 2016-05-02 23:41 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:

> This commit "2bb014820c49a63902103bac710bc86b5772e843"
> do some clean up to use the code in lib/time.c.
> But usec2ticks is still being used by security related job ring code.
> Bring back the function to avoid build break.
> 
> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> Cc: Stefano Babic <sbabic@denx.de>

.... some option not enabled by default somewhere?  I build test the
world frequently..

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160502/9a339870/attachment.sig>

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-05-02 23:41 ` Tom Rini
@ 2016-05-03  1:17   ` Peng Fan
  2016-05-03  2:04     ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Peng Fan @ 2016-05-03  1:17 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Mon, May 02, 2016 at 07:41:35PM -0400, Tom Rini wrote:
>On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
>
>> This commit "2bb014820c49a63902103bac710bc86b5772e843"
>> do some clean up to use the code in lib/time.c.
>> But usec2ticks is still being used by security related job ring code.
>> Bring back the function to avoid build break.
>> 
>> Signed-off-by: Peng Fan <van.freenix@gmail.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>
>.... some option not enabled by default somewhere?  I build test the
>world frequently..


Yeah.

Security related options not enabled by default.

If enabled these for i.MX6,
#define CONFIG_SECURE_BOOT
#define CONFIG_SYS_FSL_SEC_COMPAT    4 /* HAB version */
#define CONFIG_FSL_CAAM
#define CONFIG_CMD_DEKBLOB
#define CONFIG_SYS_FSL_SEC_LE

Met the errors:

drivers/crypto/fsl/jr.c:333: undefined reference to `usec2ticks'

Regards,
Peng.

>
>-- 
>Tom

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-05-03  1:17   ` Peng Fan
@ 2016-05-03  2:04     ` Tom Rini
  2016-05-03  2:32       ` Peng Fan
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2016-05-03  2:04 UTC (permalink / raw)
  To: u-boot

On Tue, May 03, 2016 at 09:17:51AM +0800, Peng Fan wrote:
> Hi Tom,
> 
> On Mon, May 02, 2016 at 07:41:35PM -0400, Tom Rini wrote:
> >On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
> >
> >> This commit "2bb014820c49a63902103bac710bc86b5772e843"
> >> do some clean up to use the code in lib/time.c.
> >> But usec2ticks is still being used by security related job ring code.
> >> Bring back the function to avoid build break.
> >> 
> >> Signed-off-by: Peng Fan <van.freenix@gmail.com>
> >> Cc: Stefano Babic <sbabic@denx.de>
> >
> >.... some option not enabled by default somewhere?  I build test the
> >world frequently..
> 
> 
> Yeah.
> 
> Security related options not enabled by default.
> 
> If enabled these for i.MX6,
> #define CONFIG_SECURE_BOOT
> #define CONFIG_SYS_FSL_SEC_COMPAT    4 /* HAB version */
> #define CONFIG_FSL_CAAM
> #define CONFIG_CMD_DEKBLOB
> #define CONFIG_SYS_FSL_SEC_LE
> 
> Met the errors:
> 
> drivers/crypto/fsl/jr.c:333: undefined reference to `usec2ticks'

I'd like to see this stuff moved over to Kconfig and a sample config
enabled so things don't break in the future, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160502/2e041107/attachment.sig>

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-05-03  2:04     ` Tom Rini
@ 2016-05-03  2:32       ` Peng Fan
  0 siblings, 0 replies; 7+ messages in thread
From: Peng Fan @ 2016-05-03  2:32 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Mon, May 02, 2016 at 10:04:47PM -0400, Tom Rini wrote:
>On Tue, May 03, 2016 at 09:17:51AM +0800, Peng Fan wrote:
>> Hi Tom,
>> 
>> On Mon, May 02, 2016 at 07:41:35PM -0400, Tom Rini wrote:
>> >On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
>> >
>> >> This commit "2bb014820c49a63902103bac710bc86b5772e843"
>> >> do some clean up to use the code in lib/time.c.
>> >> But usec2ticks is still being used by security related job ring code.
>> >> Bring back the function to avoid build break.
>> >> 
>> >> Signed-off-by: Peng Fan <van.freenix@gmail.com>
>> >> Cc: Stefano Babic <sbabic@denx.de>
>> >
>> >.... some option not enabled by default somewhere?  I build test the
>> >world frequently..
>> 
>> 
>> Yeah.
>> 
>> Security related options not enabled by default.
>> 
>> If enabled these for i.MX6,
>> #define CONFIG_SECURE_BOOT
>> #define CONFIG_SYS_FSL_SEC_COMPAT    4 /* HAB version */
>> #define CONFIG_FSL_CAAM
>> #define CONFIG_CMD_DEKBLOB
>> #define CONFIG_SYS_FSL_SEC_LE
>> 
>> Met the errors:
>> 
>> drivers/crypto/fsl/jr.c:333: undefined reference to `usec2ticks'
>
>I'd like to see this stuff moved over to Kconfig and a sample config
>enabled so things don't break in the future, thanks!

Ok. Will add this support.

Will you directly pick up this patch or go through i.MX tree?

Thanks,
Peng.

>
>-- 
>Tom

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-04-29  1:56 [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks Peng Fan
  2016-05-02 23:41 ` Tom Rini
@ 2016-05-10  9:30 ` Peng Fan
  2016-05-10 13:20   ` Stefano Babic
  1 sibling, 1 reply; 7+ messages in thread
From: Peng Fan @ 2016-05-10  9:30 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

Kindly ping..

Thanks,
Peng.
On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
>This commit "2bb014820c49a63902103bac710bc86b5772e843"
>do some clean up to use the code in lib/time.c.
>But usec2ticks is still being used by security related job ring code.
>Bring back the function to avoid build break.
>
>Signed-off-by: Peng Fan <van.freenix@gmail.com>
>Cc: Stefano Babic <sbabic@denx.de>
>---
> arch/arm/imx-common/timer.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
>diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
>index 92c7218..bde24af 100644
>--- a/arch/arm/imx-common/timer.c
>+++ b/arch/arm/imx-common/timer.c
>@@ -124,3 +124,20 @@ ulong get_tbclk(void)
> {
> 	return gpt_get_clk();
> }
>+
>+/*
>+ * This function is intended for SHORT delays only.
>+ * It will overflow at around 10 seconds @ 400MHz,
>+ * or 20 seconds @ 200MHz.
>+ */
>+unsigned long usec2ticks(unsigned long usec)
>+{
>+	ulong ticks;
>+
>+	if (usec < 1000)
>+		ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
>+	else
>+		ticks = ((usec / 10) * (get_tbclk() / 100000));
>+
>+	return ticks;
>+}
>-- 
>2.6.2
>

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

* [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
  2016-05-10  9:30 ` Peng Fan
@ 2016-05-10 13:20   ` Stefano Babic
  0 siblings, 0 replies; 7+ messages in thread
From: Stefano Babic @ 2016-05-10 13:20 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On 10/05/2016 11:30, Peng Fan wrote:
> Hi Stefano,
> 
> Kindly ping..
> 

I have maybe misunderstood the thread and I have supposed you want to
send a V2 with the stuff related to secure moved to Kconfig, as
requested by Tom. For that reason, you find your patch tagged with
"Changes requested" in patchwork. Anyway, this can be done in a follow
up patch.

I will completely agree if this is done separately.

Best regards,
Stefano



> Thanks,
> Peng.
> On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
>> This commit "2bb014820c49a63902103bac710bc86b5772e843"
>> do some clean up to use the code in lib/time.c.
>> But usec2ticks is still being used by security related job ring code.
>> Bring back the function to avoid build break.
>>
>> Signed-off-by: Peng Fan <van.freenix@gmail.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> ---
>> arch/arm/imx-common/timer.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
>> index 92c7218..bde24af 100644
>> --- a/arch/arm/imx-common/timer.c
>> +++ b/arch/arm/imx-common/timer.c
>> @@ -124,3 +124,20 @@ ulong get_tbclk(void)
>> {
>> 	return gpt_get_clk();
>> }
>> +
>> +/*
>> + * This function is intended for SHORT delays only.
>> + * It will overflow at around 10 seconds @ 400MHz,
>> + * or 20 seconds @ 200MHz.
>> + */
>> +unsigned long usec2ticks(unsigned long usec)
>> +{
>> +	ulong ticks;
>> +
>> +	if (usec < 1000)
>> +		ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
>> +	else
>> +		ticks = ((usec / 10) * (get_tbclk() / 100000));
>> +
>> +	return ticks;
>> +}
>> -- 
>> 2.6.2
>>


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2016-05-10 13:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29  1:56 [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks Peng Fan
2016-05-02 23:41 ` Tom Rini
2016-05-03  1:17   ` Peng Fan
2016-05-03  2:04     ` Tom Rini
2016-05-03  2:32       ` Peng Fan
2016-05-10  9:30 ` Peng Fan
2016-05-10 13:20   ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.