[U-Boot] TI:OMAP: [PATCH 1/7] OMAP3 Beagle Update revision detection

From 2dce4d64339a26144eac2ed56eb664cc1ea527c7 Mon Sep 17 00:00:00 2001
From: Syed Mohammed Khasim khasim@ti.com Date: Mon, 18 Jan 2010 18:03:42 +0530 Subject: [PATCH] OMAP3 Beagle Update revision detection
New BeagleBoard revision C4 uses a new ID. Update revision detection.
Signed-off-by: Dirk Behme dirk.behme@googlemail.com Signed-off-by: Syed Mohammed Khasim khasim@ti.com --- board/ti/beagle/beagle.c | 64 ++++++++++++++++++++++++++++----------------- board/ti/beagle/beagle.h | 8 ++++- 2 files changed, 46 insertions(+), 26 deletions(-)
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 3b4c9e7..23985ea 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -38,7 +38,7 @@ #include <asm/mach-types.h> #include "beagle.h"
-static int beagle_revision_c; +static int beagle_revision;
/* * Routine: board_init @@ -60,41 +60,57 @@ int board_init(void) /* * Routine: beagle_get_revision * Description: Return the revision of the BeagleBoard this code is running on. - * If it is a revision Ax/Bx board, this function returns 0, - * on a revision C board you will get a 1. */ int beagle_get_revision(void) { - return beagle_revision_c; + return beagle_revision; }
/* * Routine: beagle_identify - * Description: Detect if we are running on a Beagle revision Ax/Bx or - * Cx. This can be done by GPIO_171. If this is low, we are - * running on a revision C board. + * Description: Detect if we are running on a Beagle revision Ax/Bx, + * C1/2/3, C4 or D. This can be done by reading + * the level of GPIO173, GPIO172 and GPIO171. This should + * result in + * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx + * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3 + * GPIO173, GPIO172, GPIO171: 1 0 1 => C4 + * GPIO173, GPIO172, GPIO171: 0 0 0 => D */ void beagle_identify(void) { - beagle_revision_c = 0; - if (!omap_request_gpio(171)) { - unsigned int val; - - omap_set_gpio_direction(171, 1); - val = omap_get_gpio_datain(171); - omap_free_gpio(171); - - if (val) - beagle_revision_c = 0; - else - beagle_revision_c = 1; - } + omap_request_gpio(171); + omap_request_gpio(172); + omap_request_gpio(173); + omap_set_gpio_direction(171, 1); + omap_set_gpio_direction(172, 1); + omap_set_gpio_direction(173, 1); + + beagle_revision = omap_get_gpio_datain(173) << 2 | + omap_get_gpio_datain(172) << 1 | + omap_get_gpio_datain(171); + omap_free_gpio(171); + omap_free_gpio(172); + omap_free_gpio(173);
printf("Board revision "); - if (beagle_revision_c) - printf("C\n"); - else + + switch (beagle_revision) { + case REVISION_AXBX: printf("Ax/Bx\n"); + break; + case REVISION_CX: + printf("C1/C2/C3\n"); + break; + case REVISION_C4: + printf("C4\n"); + break; + case REVISION_D: + printf("D\n"); + break; + default: + printf("unknown 0x%02x\n", beagle_revision); + } }
/* @@ -137,7 +153,7 @@ void set_muxconf_regs(void) { MUX_BEAGLE();
- if (beagle_revision_c) { + if (beagle_revision != REVISION_AXBX) { MUX_BEAGLE_C(); } } diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h index 7fe6275..d1d5d27 100644 --- a/board/ti/beagle/beagle.h +++ b/board/ti/beagle/beagle.h @@ -33,7 +33,11 @@ const omap3_sysinfo sysinfo = { #endif };
-#define BOARD_REVISION_MASK (0x1 << 11) +/* BeagleBoard revisions */ +#define REVISION_AXBX 0x7 +#define REVISION_CX 0x6 +#define REVISION_C4 0x5 +#define REVISION_D 0x0
/* * IEN - Input Enable @@ -264,7 +268,7 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*GPIO_170*/\ MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | EN | M4)) /*GPIO_171*/\ MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | EN | M4)) /*GPIO_172*/\ - MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTU | EN | M4)) /*GPIO_173*/\ MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\ MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\ MUX_VAL(CP(MCSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\

Khasim Syed Mohammed wrote:
From 2dce4d64339a26144eac2ed56eb664cc1ea527c7 Mon Sep 17 00:00:00 2001 From: Syed Mohammed Khasim khasim@ti.com Date: Mon, 18 Jan 2010 18:03:42 +0530 Subject: [PATCH] OMAP3 Beagle Update revision detection
New BeagleBoard revision C4 uses a new ID. Update revision detection.
This patch set caused regressions in MAKEALL arm These must be fixed.
omap3_beagle cmd_i2c.c:109: warning: missing braces around initializer cmd_i2c.c:109: warning: (near initialization for 'i2c_no_probes[0]') beagle.c: In function 'misc_init_r': beagle.c:143: warning: implicit declaration of function 'twl4030_pmrecv_vsel_cfg' beagle.c:152: warning: implicit declaration of function 'prcm_config_720mhz'
The changes I asked from for 1/7 were done. Tom

On 24.01.2010 01:03, Tom wrote:
Khasim Syed Mohammed wrote:
From 2dce4d64339a26144eac2ed56eb664cc1ea527c7 Mon Sep 17 00:00:00 2001
Khasim: The 'From' line of your patch starts with an additional '>'
From 2dce4d64339a2 ...
Could you check where this comes from? Maybe this confuses the mailing list archive
http://lists.denx.de/pipermail/u-boot/2010-January/066629.html
?
And could you try to add a 'vX' version to the subject of your patches? E.g.
[PATCH 1/7 v4] OMAP3 Bea ....
This would really help to identify the patch versions.
From: Syed Mohammed Khasimkhasim@ti.com Date: Mon, 18 Jan 2010 18:03:42 +0530 Subject: [PATCH] OMAP3 Beagle Update revision detection
New BeagleBoard revision C4 uses a new ID. Update revision detection.
This patch set caused regressions in MAKEALL arm
Tom: On recent master a84b655fab2bc021fdafa91d1196cf826474cdd8 this patch seems to compile fine (?)
Best regards
Dirk
These must be fixed.
omap3_beagle cmd_i2c.c:109: warning: missing braces around initializer cmd_i2c.c:109: warning: (near initialization for 'i2c_no_probes[0]') beagle.c: In function 'misc_init_r': beagle.c:143: warning: implicit declaration of function 'twl4030_pmrecv_vsel_cfg' beagle.c:152: warning: implicit declaration of function 'prcm_config_720mhz'
The changes I asked from for 1/7 were done. Tom _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Am Sonntag, den 24.01.2010, 09:59 +0100 schrieb Dirk Behme:
[…]
And could you try to add a 'vX' version to the subject of your patches? E.g.
[PATCH 1/7 v4] OMAP3 Bea ....
This would really help to identify the patch versions.
Just for your information, because it is not that obvious. You can achieve this when running `git format-patch` by using `--subject-prefix="PATCH v4"` (for example, see `git help format-patch`).
[…]
Thanks and I wish Khasim luck that the next series is going to be the last iteration,
Paul

Dear Dirk Behme,
In message 4B5C0C00.9070707@googlemail.com you wrote:
Khasim: The 'From' line of your patch starts with an additional '>'
From 2dce4d64339a2 ...
Could you check where this comes from? Maybe this confuses the mailing list archive
This is pretty noremal. It should not affect anything. It is actually needed for all MUAs who store their messages in mailbox format.
Best regards,
Wolfgang Denk

On 24.01.2010 15:26, Wolfgang Denk wrote:
Dear Dirk Behme,
In message4B5C0C00.9070707@googlemail.com you wrote:
Khasim: The 'From' line of your patch starts with an additional '>'
From 2dce4d64339a2 ...
Could you check where this comes from? Maybe this confuses the mailing list archive
This is pretty noremal. It should not affect anything. It is actually needed for all MUAs who store their messages in mailbox format.
Ok.
Any other idea what causes the broken ml archive
http://lists.denx.de/pipermail/u-boot/2010-January/066629.html
then?
Best regards
Dirk

Dear Dirk Behme,
In message 4B5C9C8E.9060401@googlemail.com you wrote:
Any other idea what causes the broken ml archive
http://lists.denx.de/pipermail/u-boot/2010-January/066629.html
then?
I have no idea. The mbox entry looks ok, and also the article looks OK on gmane.
Best regards,
Wolfgang Denk

On 24.01.2010 01:03, Tom wrote:
Khasim Syed Mohammed wrote:
From 2dce4d64339a26144eac2ed56eb664cc1ea527c7 Mon Sep 17 00:00:00 2001 From: Syed Mohammed Khasimkhasim@ti.com Date: Mon, 18 Jan 2010 18:03:42 +0530 Subject: [PATCH] OMAP3 Beagle Update revision detection
New BeagleBoard revision C4 uses a new ID. Update revision detection.
This patch set caused regressions in MAKEALL arm These must be fixed.
omap3_beagle cmd_i2c.c:109: warning: missing braces around initializer cmd_i2c.c:109: warning: (near initialization for 'i2c_no_probes[0]') beagle.c: In function 'misc_init_r': beagle.c:143: warning: implicit declaration of function 'twl4030_pmrecv_vsel_cfg' beagle.c:152: warning: implicit declaration of function 'prcm_config_720mhz'
With recent U-Boot main git head "a1b322a98319de568b3bc38029ef7e123643c1e8" I don't see this:
./MAKEALL omap3_beagle
Configuring for omap3_beagle board... text data bss dec hex filename 184267 9764 202428 396459 60cab ./u-boot
--------------------- SUMMARY ---------------------------- Boards compiled: 1 ---------------------------------------------------------
Is this already gone? Or how to reproduce it?
Dirk
participants (5)
-
Dirk Behme
-
Khasim Syed Mohammed
-
Paul Menzel
-
Tom
-
Wolfgang Denk