FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 10-11-2010, 04:36 PM
Mathieu Poirier
 
Default UBUNTU - ARM: igepv2: Introduce function to dectect HW version

SRU Justification:

Impact: This patch is part of a series for fix for the IGEPv2 board.
There are currently two version of the board but no functionality to
differentiate them from the code.

Fix: Introducing functionality in the board file to probe GPIOs and set
the "hwrev" flag.

Testcase: Without this patch, the code has no way to know which board is
it working on and therefore can't take decisions on specific actions to
take on each board.


>From aa4a3e99b96de115ebe54921f62ebde2e3afc515 Mon Sep 17 00:00:00 2001
From: Enric Balletbo i Serra <eballetbo@gmail.com>
Date: Mon, 11 Oct 2010 10:11:51 -0600
Subject: [PATCH 3/6] UBUNTU - ARM: igepv2: Introduce function to dectect HW version

There are currently two versions of IGEPv2 board, this patch
introduces a function to detect the hardware revision of IGEP board.

--------------------------
| Id. | Hw Rev. | GPIO 28 |
--------------------------
| 0 | B/C | high |
| 1 | C | low |
--------------------------

This work was tested by the community and also been submitted here:
http://marc.info/?l=linux-omap&m=128628886320281&w=2

BugLink: https://bugs.launchpad.net/bugs/654586

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
---
arch/arm/mach-omap2/board-igep0020.c | 47 ++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 29a1e24..7715701 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -45,6 +45,49 @@
#define IGEP2_GPIO_WIFI_NPD 94
#define IGEP2_GPIO_WIFI_NRESET 95

+/*
+ * IGEP2 Hardware Revision Table
+ *
+ * --------------------------
+ * | Id. | Hw Rev. | HW0 (28) |
+ * --------------------------
+ * | 0 | B/C | high |
+ * | 1 | C | low |
+ * --------------------------
+ */
+
+#define IGEP2_BOARD_HWREV_B 0
+#define IGEP2_BOARD_HWREV_C 1
+
+static u8 hwrev;
+
+static void __init igep2_get_revision(void)
+{
+ u8 ret;
+
+ omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
+
+ if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_HW0_REV") == 0) &&
+ (gpio_direction_input(IGEP2_GPIO_LED1_RED) == 0)) {
+ ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
+ if (ret == 0) {
+ pr_info("IGEP2: Hardware Revision C (B-NON compatible)
");
+ hwrev = IGEP2_BOARD_HWREV_C;
+ } else if (ret == 1) {
+ pr_info("IGEP2: Hardware Revision B/C (B compatible)
");
+ hwrev = IGEP2_BOARD_HWREV_B;
+ } else {
+ pr_err("IGEP2: Unknown Hardware Revision
");
+ hwrev = -1;
+ }
+ } else {
+ pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV
");
+ pr_err("IGEP2: Unknown Hardware Revision
");
+ }
+
+ gpio_free(IGEP2_GPIO_LED1_RED);
+}
+
#if defined(CONFIG_MTD_ONENAND_OMAP2) ||
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)

@@ -537,6 +580,10 @@ static struct omap_board_mux board_mux[] __initdata = {
static void __init igep2_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
+ /* Get IGEP2 hardware revision */
+ igep2_get_revision();
+
igep2_i2c_init();
platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
omap_serial_init();
--
1.7.0.4





--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 10-12-2010, 08:20 AM
Lee Jones
 
Default UBUNTU - ARM: igepv2: Introduce function to dectect HW version

On 11/10/10 17:36, Mathieu Poirier wrote:
> SRU Justification:
>
> Impact: This patch is part of a series for fix for the IGEPv2 board.
> There are currently two version of the board but no functionality to
> differentiate them from the code.
>
> Fix: Introducing functionality in the board file to probe GPIOs and set
> the "hwrev" flag.
>
> Testcase: Without this patch, the code has no way to know which board is
> it working on and therefore can't take decisions on specific actions to
> take on each board.
>
>
>>From aa4a3e99b96de115ebe54921f62ebde2e3afc515 Mon Sep 17 00:00:00 2001
> From: Enric Balletbo i Serra <eballetbo@gmail.com>
> Date: Mon, 11 Oct 2010 10:11:51 -0600
> Subject: [PATCH 3/6] UBUNTU - ARM: igepv2: Introduce function to dectect HW version
>
> There are currently two versions of IGEPv2 board, this patch
> introduces a function to detect the hardware revision of IGEP board.
>
> --------------------------
> | Id. | Hw Rev. | GPIO 28 |
> --------------------------
> | 0 | B/C | high |
> | 1 | C | low |
> --------------------------
>
> This work was tested by the community and also been submitted here:
> http://marc.info/?l=linux-omap&m=128628886320281&w=2
>
> BugLink: https://bugs.launchpad.net/bugs/654586
>
> Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Signed-off-by: Mathieu J Poirier <mathieu.poirier@canonical.com>
> ---
> arch/arm/mach-omap2/board-igep0020.c | 47 ++++++++++++++++++++++++++++++++++
> 1 files changed, 47 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 29a1e24..7715701 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -45,6 +45,49 @@
> #define IGEP2_GPIO_WIFI_NPD 94
> #define IGEP2_GPIO_WIFI_NRESET 95
>
> +/*
> + * IGEP2 Hardware Revision Table
> + *
> + * --------------------------
> + * | Id. | Hw Rev. | HW0 (28) |
> + * --------------------------
> + * | 0 | B/C | high |
> + * | 1 | C | low |
> + * --------------------------
> + */
> +
> +#define IGEP2_BOARD_HWREV_B 0
> +#define IGEP2_BOARD_HWREV_C 1
> +
> +static u8 hwrev;
> +
> +static void __init igep2_get_revision(void)
> +{
> + u8 ret;
> +
> + omap_mux_init_gpio(IGEP2_GPIO_LED1_RED, OMAP_PIN_INPUT);
> +
> + if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_HW0_REV") == 0) &&
> + (gpio_direction_input(IGEP2_GPIO_LED1_RED) == 0)) {
> + ret = gpio_get_value(IGEP2_GPIO_LED1_RED);
> + if (ret == 0) {
> + pr_info("IGEP2: Hardware Revision C (B-NON compatible)
");
> + hwrev = IGEP2_BOARD_HWREV_C;
> + } else if (ret == 1) {
> + pr_info("IGEP2: Hardware Revision B/C (B compatible)
");
> + hwrev = IGEP2_BOARD_HWREV_B;
> + } else {
> + pr_err("IGEP2: Unknown Hardware Revision
");
> + hwrev = -1;
> + }
> + } else {
> + pr_warning("IGEP2: Could not obtain gpio GPIO_HW0_REV
");
> + pr_err("IGEP2: Unknown Hardware Revision
");
> + }
> +
> + gpio_free(IGEP2_GPIO_LED1_RED);
> +}
> +
> #if defined(CONFIG_MTD_ONENAND_OMAP2) ||
> defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
>
> @@ -537,6 +580,10 @@ static struct omap_board_mux board_mux[] __initdata = {
> static void __init igep2_init(void)
> {
> omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> +
> + /* Get IGEP2 hardware revision */
> + igep2_get_revision();
> +
> igep2_i2c_init();
> platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
> omap_serial_init();

Signed-off-by: Lee Jones <lee.jones@canonical.com>

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 04:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org