Skip to contentSkip to conversation

openrisc/bitops: add hweightX defines

PATCH New Stefan Kristiansson 5 participants 9 messages Feb 22, 2012 – Oct 2, 2012

Subsystems (2)
lore
Share & tools
lore

Stefan Kristiansson

author maintainer
#0 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

---
 arch/openrisc/include/asm/bitops.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/openrisc/include/asm/bitops.h +4 -0
index c001a5d..c76a409 100644
@@ -25,4 +25,8 @@
 #define PLATFORM_FFS
 #include <asm/bitops/ffs.h>
 
+#define hweight32(x) generic_hweight32(x)
+#define hweight16(x) generic_hweight16(x)
+#define hweight8(x) generic_hweight8(x)
+
 #endif /* __ASM_GENERIC_BITOPS_H */
Signature · 1 line
1.7.5.4
author maintainer
#1 lore raw

PATCH 1/1 openrisc: implement get_ticks and get_tbclk

---
 arch/openrisc/lib/timer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/openrisc/lib/timer.c +10 -0
index 4e92a31..89e644b 100644
@@ -86,6 +86,16 @@ void set_timer(ulong t)
 	timestamp = t;
 }
 
+unsigned long long get_ticks(void)
+{
+	return get_timer(0);
+}
+
+ulong get_tbclk(void)
+{
+	return CONFIG_SYS_HZ;
+}
+
 void __udelay(ulong usec)
 {
 	ulong elapsed = 0;
Signature · 1 line
1.7.5.4
#2 lore raw

[U-Boot] openrisc: implement get_ticks and get_tbclk

Quoted 1 line · Stefan Kristiansson

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121002/f54fbf64/attachment.pgp>
author maintainer
#3 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

In reply to Stefan Kristiansson
Quoted 21 lines · Stefan Kristiansson
---
 arch/openrisc/include/asm/bitops.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/openrisc/include/asm/bitops.h +4 -0
index c001a5d..c76a409 100644
@@ -25,4 +25,8 @@
 #define PLATFORM_FFS
 #include <asm/bitops/ffs.h>
 
+#define hweight32(x) generic_hweight32(x)
+#define hweight16(x) generic_hweight16(x)
+#define hweight8(x) generic_hweight8(x)
+
 #endif /* __ASM_GENERIC_BITOPS_H */
Signature · 1 line
1.7.5.4

Sorry, screwed up when I format-patched this,
there is no part 2 to it.

Stefan

#4 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

Quoted 21 lines · Stefan Kristiansson
Quoted 20 lines

---

 arch/openrisc/include/asm/bitops.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/openrisc/include/asm/bitops.h index c001a5d..c76a409 100644

arch/openrisc/include/asm/bitops.h +4 -0
@@ -25,4 +25,8 @@
 
 #define PLATFORM_FFS
 #include <asm/bitops/ffs.h>
 
+#define hweight32(x) generic_hweight32(x)
+#define hweight16(x) generic_hweight16(x)
+#define hweight8(x) generic_hweight8(x)
+
Quoted 5 lines
Quoted 1 line

#endif /* __ASM_GENERIC_BITOPS_H */

Sorry, screwed up when I format-patched this,
there is no part 2 to it.

Hey,

looks like get_tbclk() and get_ticks() looks all the same just about everywhere. What about introducing a weak alias for these functions so in case weird platform pops up, these can be overridden.

M

#5 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

Quoted 3 lines · On Wednesday 22 February 2012 17:15:50 Marek Vasut wrote:

looks like get_tbclk() and get_ticks() looks all the same just about everywhere. What about introducing a weak alias for these functions so in case weird platform pops up, these can be overridden.

the unified timer core that Graeme/Simon were doing takes care of that implicitly
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120222/2b050ce0/attachment.pgp>

#6 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

Quoted 7 lines · On Wednesday 22 February 2012 17:15:50 Marek Vasut wrote:
Quoted 3 lines

looks like get_tbclk() and get_ticks() looks all the same just about everywhere. What about introducing a weak alias for these functions so in case weird platform pops up, these can be overridden.

the unified timer core that Graeme/Simon were doing takes care of that implicitly

Unified timer core?

M

#7 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

Ho Marek,

Quoted 9 lines · Marek Vasut
Quoted 7 lines · On Wednesday 22 February 2012 17:15:50 Marek Vasut wrote:
Quoted 3 lines

looks like get_tbclk() and get_ticks() looks all the same just about everywhere. What about introducing a weak alias for these functions so in case weird platform pops up, these can be overridden.

the unified timer core that Graeme/Simon were doing takes care of that implicitly

Unified timer core?

I don't know what this has to do with openrisc/bitops but a while ago there was a discussion regarding the implementation of new timer API. I did some initial tidy-up work but we kind of got stuck on the finer details. It still in my todo list, but several other items have taken priority

Regards,

Graeme

#8 lore raw

PATCH 1/2 openrisc/bitops: add hweightX defines

In reply to Stefan Kristiansson
Quoted 1 line · Stefan Kristiansson

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121002/d44c7235/attachment.pgp>