linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] OLPC: extended board revision detection
@ 2010-09-22 16:43 Daniel Drake
  2010-09-22 18:28 ` Andres Salomon
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2010-09-22 16:43 UTC (permalink / raw)
  To: tglx; +Cc: x86, linux-kernel, dilinger

Add some functions to easily detect which version of the laptop we are
running on, and document the board IDs which are accepted by olpc_board().

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 arch/x86/include/asm/olpc.h |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/olpc.h b/arch/x86/include/asm/olpc.h
index 101229b..9f3219b 100644
--- a/arch/x86/include/asm/olpc.h
+++ b/arch/x86/include/asm/olpc.h
@@ -23,6 +23,21 @@ extern struct olpc_platform_t olpc_platform_info;
  * and the minor build number withing 0x000f.  Pre-builds have a minor
  * number less than 8, and normal builds start at 8.  For example, 0x0B10
  * is a PreB1, and 0x0C18 is a C1.
+ *
+ * History of board IDs that you can pass into this function:
+ *  0xb1 - XO-1 B1
+ *  0xb2 - XO-1 B2
+ *  0xb3 - XO-1 B3
+ *  0xc1 - XO-1 C1
+ *  0xc2 - XO-1 C2
+ *  0xd0 - XO-1.5 A0 and A1 test
+ *  0xd1 - XO-1.5 B1 and B2 test
+ *  0xd2 - XO-1.5 B3 test
+ *  0xd3 - XO-1.5 C1 initial factory build (12/2009)
+ *  0xd4 - XO-1.5 C2 ramp build (02/2010)
+ *  0xd3 - XO-1.5 mass production
+ *  0xd4 - XO-1.5
+ *  0xd5 - XO-1.5
  */
 
 static inline uint32_t olpc_board(uint8_t id)
@@ -40,6 +55,18 @@ static inline int machine_is_olpc(void)
 	return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
 }
 
+static inline int machine_is_olpc_xo_1(void)
+{
+	return machine_is_olpc() &&
+		olpc_platform_info.boardrev < olpc_board_pre(0xd0);
+}
+
+static inline int machine_is_olpc_xo_1_5(void)
+{
+	return machine_is_olpc() &&
+		olpc_platform_info.boardrev >= olpc_board_pre(0xd0);
+}
+
 /*
  * The DCON is OLPC's Display Controller.  It has a number of unique
  * features that we might want to take advantage of..
@@ -69,6 +96,16 @@ static inline int machine_is_olpc(void)
 	return 0;
 }
 
+static inline int machine_is_olpc_xo_1(void)
+{
+	return 0;
+}
+
+static inline int machine_is_olpc_xo_1_5(void)
+{
+	return 0;
+}
+
 static inline int olpc_has_dcon(void)
 {
 	return 0;
-- 
1.7.2.2


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

* Re: [PATCH 1/3] OLPC: extended board revision detection
  2010-09-22 16:43 [PATCH 1/3] OLPC: extended board revision detection Daniel Drake
@ 2010-09-22 18:28 ` Andres Salomon
  0 siblings, 0 replies; 2+ messages in thread
From: Andres Salomon @ 2010-09-22 18:28 UTC (permalink / raw)
  To: Daniel Drake; +Cc: tglx, x86, linux-kernel

On Wed, 22 Sep 2010 17:43:07 +0100 (BST)
Daniel Drake <dsd@laptop.org> wrote:

> Add some functions to easily detect which version of the laptop we are
> running on, and document the board IDs which are accepted by
> olpc_board().
> 
> Signed-off-by: Daniel Drake <dsd@laptop.org>
> ---
>  arch/x86/include/asm/olpc.h |   37
> +++++++++++++++++++++++++++++++++++++ 1 files changed, 37
> insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/include/asm/olpc.h b/arch/x86/include/asm/olpc.h
> index 101229b..9f3219b 100644
> --- a/arch/x86/include/asm/olpc.h
> +++ b/arch/x86/include/asm/olpc.h
> @@ -23,6 +23,21 @@ extern struct olpc_platform_t olpc_platform_info;
>   * and the minor build number withing 0x000f.  Pre-builds have a
> minor
>   * number less than 8, and normal builds start at 8.  For example,
> 0x0B10
>   * is a PreB1, and 0x0C18 is a C1.
> + *
> + * History of board IDs that you can pass into this function:
> + *  0xb1 - XO-1 B1
> + *  0xb2 - XO-1 B2
> + *  0xb3 - XO-1 B3
> + *  0xc1 - XO-1 C1
> + *  0xc2 - XO-1 C2
> + *  0xd0 - XO-1.5 A0 and A1 test
> + *  0xd1 - XO-1.5 B1 and B2 test
> + *  0xd2 - XO-1.5 B3 test
> + *  0xd3 - XO-1.5 C1 initial factory build (12/2009)
> + *  0xd4 - XO-1.5 C2 ramp build (02/2010)
> + *  0xd3 - XO-1.5 mass production
> + *  0xd4 - XO-1.5
> + *  0xd5 - XO-1.5
>   */
>  
>  static inline uint32_t olpc_board(uint8_t id)
> @@ -40,6 +55,18 @@ static inline int machine_is_olpc(void)
>  	return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
>  }
>  
> +static inline int machine_is_olpc_xo_1(void)
> +{
> +	return machine_is_olpc() &&
> +		olpc_platform_info.boardrev < olpc_board_pre(0xd0);
> +}
> +
> +static inline int machine_is_olpc_xo_1_5(void)
> +{
> +	return machine_is_olpc() &&
> +		olpc_platform_info.boardrev >= olpc_board_pre(0xd0);
> +}
> +


These should be returning bools (ditto for the rest of the patches in
this series).  Otherwise, this looks fine to me.

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

end of thread, other threads:[~2010-09-22 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-22 16:43 [PATCH 1/3] OLPC: extended board revision detection Daniel Drake
2010-09-22 18:28 ` Andres Salomon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).