All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] BeagleBoard: turn off clocks in ehci_stop
@ 2011-08-16  2:36 Joel A Fernandes
  2011-08-16  2:36 ` [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command Joel A Fernandes
  2011-08-16  2:36 ` [U-Boot] [PATCH 3/3] BeagleBoard: Configure DVI/S-video Joel A Fernandes
  0 siblings, 2 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-08-16  2:36 UTC (permalink / raw)
  To: u-boot

From: Koen Kooi <koen@dominion.thruhere.net>

This fixes display problems in linux

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
---
 board/ti/beagle/beagle.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 7768901..a958545 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -356,6 +356,12 @@ int ehci_hcd_stop(void)
 	pr_debug("Resetting OMAP3 EHCI\n");
 	omap_set_gpio_dataout(GPIO_PHY_RESET, 0);
 	writel(OMAP_UHH_SYSCONFIG_SOFTRESET, OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG);
+	/* disable USB clocks */
+	struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+	sr32(&prcm_base->iclken_usbhost, 0, 1, 0);
+	sr32(&prcm_base->fclken_usbhost, 0, 2, 0);
+	sr32(&prcm_base->iclken3_core, 2, 1, 0);
+	sr32(&prcm_base->fclken3_core, 2, 1, 0);
 	return 0;
 }
 
-- 
1.7.1

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-08-16  2:36 [U-Boot] [PATCH 1/3] BeagleBoard: turn off clocks in ehci_stop Joel A Fernandes
@ 2011-08-16  2:36 ` Joel A Fernandes
  2011-09-08  6:13   ` Albert ARIBAUD
  2011-09-08  8:05   ` Wolfgang Denk
  2011-08-16  2:36 ` [U-Boot] [PATCH 3/3] BeagleBoard: Configure DVI/S-video Joel A Fernandes
  1 sibling, 2 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-08-16  2:36 UTC (permalink / raw)
  To: u-boot

From: Jason Kridner <jkridner@beagleboard.org>

Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
    Author: Greg Turner <gregturner@ti.com>
    Date:   Tue May 25 09:19:06 2010 -0500

    New u-boot command for status of USER button on BeagleBoard-xM

         Modified bootcmd to check the staus at boot time and set
	 filename of the boot script.

* Moved to a BeagleBoard specific file.
* Removed changes to default boot command from adding userbutton
  command.
* Made to handle pre-xM boards.
* Flipped polarity of the return value to avoid confusion.  Success (0)
  is when the button is pressed.  Failure (1) is when the button is NOT
  pressed.
* Used latest revision getting function.
* Used latest macros for board revision.
* Added xM-C revision definition (optional, since it was default)
* updated default configuration with UserButton functionality
  * Added a separate bootenv variable to load a user defined .txt file
  * Added an example, showing how a different environment file can be loaded with
    the user button pressed

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Cc: Greg Turner <gregturner@ti.com>
---
 board/ti/beagle/beagle.c       |   56 ++++++++++++++++++++++++++++++++++++++++
 include/configs/omap3_beagle.h |    7 ++++-
 2 files changed, 62 insertions(+), 1 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index a958545..8dc8dfa 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -50,6 +50,7 @@ extern struct ehci_hccr *hccr;
 extern volatile struct ehci_hcor *hcor;
 #endif
 #include "beagle.h"
+#include <command.h>
 
 #define pr_debug(fmt, args...) debug(fmt, ##args)
 
@@ -446,3 +447,58 @@ int ehci_hcd_init(void)
 }
 
 #endif /* CONFIG_USB_EHCI */
+
+/*
+ * This command returns the status of the user button on beagle xM
+ * Input - none
+ * Returns - 	1 if button is held down
+ *		0 if button is not held down
+ */
+int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	int     button = 0;
+	int	gpio;
+
+	/*
+	 * pass address parameter as argv[0] (aka command name),
+	 * and all remaining args
+	 */
+	switch (get_board_revision()) {
+	case REVISION_AXBX:
+	case REVISION_CX:
+	case REVISION_C4:
+		gpio = 7;
+		break;
+	case REVISION_XM_A:
+	case REVISION_XM_B:
+	case REVISION_XM_C:
+	default:
+		gpio = 4;
+		break;
+	}
+	omap_request_gpio(gpio);
+	omap_set_gpio_direction(gpio, 1);
+	printf("The user button is currently ");
+	if(omap_get_gpio_datain(gpio))
+	{
+		button = 1;
+		printf("PRESSED.\n");
+	}
+	else
+	{
+		button = 0;
+		printf("NOT pressed.\n");
+	}
+
+	omap_free_gpio(gpio);
+
+	return !button;
+}
+
+/* -------------------------------------------------------------------- */
+
+U_BOOT_CMD(
+	userbutton, CONFIG_SYS_MAXARGS, 1,	do_userbutton,
+	"Return the status of the BeagleBoard USER button",
+	""
+);
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index c41d48e..a494f99 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -227,7 +227,8 @@
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"bootenv=uEnv.txt\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t $loadaddr $filesize\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
@@ -241,8 +242,12 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc rescan ${mmcdev}; then " \
+		"if userbutton; then " \
+			"setenv bootenv user.txt;" \
+		"fi;" \
 		"echo SD/MMC found on device ${mmcdev};" \
 		"if run loadbootenv; then " \
+			"echo Loaded environment from ${bootenv};" \
 			"run importbootenv;" \
 		"fi;" \
 		"if test -n $uenvcmd; then " \
-- 
1.7.1

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

* [U-Boot] [PATCH 3/3] BeagleBoard: Configure DVI/S-video
  2011-08-16  2:36 [U-Boot] [PATCH 1/3] BeagleBoard: turn off clocks in ehci_stop Joel A Fernandes
  2011-08-16  2:36 ` [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command Joel A Fernandes
@ 2011-08-16  2:36 ` Joel A Fernandes
  1 sibling, 0 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-08-16  2:36 UTC (permalink / raw)
  To: u-boot

From: Jason Kridner <jkridner@beagleboard.org>

Based on patches from Syed Mohammed Khasim (khasim at ti.com).

Configures the output of the BeagleBoard DVI to be orange.
Configures the output of the BeagleBoard S-Video to be a colorbar.

Changed display_init to beagle_display_init as suggested by Igor Grinberg:
http://www.mail-archive.com/u-boot at lists.denx.de/msg51446.html

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
---
 board/ti/beagle/beagle.c |   24 +++++++++++++
 board/ti/beagle/beagle.h |   86 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 8dc8dfa..13fe39b 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -165,6 +165,28 @@ unsigned int get_expansion_id(void)
 }
 
 /*
+ * Configure DSS to display background color on DVID
+ * Configure VENC to display color bar on S-Video
+ */
+void beagle_display_init(void)
+{
+	omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
+	switch (get_board_revision()) {
+	case REVISION_AXBX:
+	case REVISION_CX:
+	case REVISION_C4:
+		omap3_dss_panel_config(&dvid_cfg);
+		break;
+	case REVISION_XM_A:
+	case REVISION_XM_B:
+	case REVISION_XM_C:
+	default:
+		omap3_dss_panel_config(&dvid_cfg_xm);
+		break;
+	}
+}
+
+/*
  * Routine: misc_init_r
  * Description: Configure board specific parts
  */
@@ -324,6 +346,8 @@ int misc_init_r(void)
 		GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
 
 	dieid_num_r();
+	beagle_display_init();
+	omap3_dss_enable();
 
 	return 0;
 }
diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
index 04247cd..18bfaa8 100644
--- a/board/ti/beagle/beagle.h
+++ b/board/ti/beagle/beagle.h
@@ -23,6 +23,8 @@
 #ifndef _BEAGLE_H_
 #define _BEAGLE_H_
 
+#include <asm/arch/dss.h>
+
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 	"OMAP3 Beagle board",
@@ -472,4 +474,88 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(MMC2_DAT6),      (IDIS | PTU | EN  | M4)) /*GPIO_138 BT_EN*/\
 	MUX_VAL(CP(MMC2_DAT7),      (IDIS | PTU | EN  | M4)) /*GPIO_139 WLAN_EN*/
 
+/*
+ * Display Configuration
+ */
+
+#define DVI_BEAGLE_ORANGE_COL		0x00FF8000
+#define VENC_HEIGHT			0x00ef
+#define VENC_WIDTH			0x027f
+
+/*
+ * Configure VENC in DSS for Beagle to generate Color Bar
+ *
+ * Kindly refer to OMAP TRM for definition of these values.
+ */
+static const struct venc_regs venc_config_std_tv = {
+	.status					= 0x0000001B,
+	.f_control				= 0x00000040,
+	.vidout_ctrl				= 0x00000000,
+	.sync_ctrl				= 0x00008000,
+	.llen					= 0x00008359,
+	.flens					= 0x0000020C,
+	.hfltr_ctrl				= 0x00000000,
+	.cc_carr_wss_carr			= 0x043F2631,
+	.c_phase				= 0x00000024,
+	.gain_u					= 0x00000130,
+	.gain_v					= 0x00000198,
+	.gain_y					= 0x000001C0,
+	.black_level				= 0x0000006A,
+	.blank_level				= 0x0000005C,
+	.x_color				= 0x00000000,
+	.m_control				= 0x00000001,
+	.bstamp_wss_data			= 0x0000003F,
+	.s_carr					= 0x21F07C1F,
+	.line21					= 0x00000000,
+	.ln_sel					= 0x00000015,
+	.l21__wc_ctl				= 0x00001400,
+	.htrigger_vtrigger			= 0x00000000,
+	.savid__eavid				= 0x069300F4,
+	.flen__fal				= 0x0016020C,
+	.lal__phase_reset			= 0x00060107,
+	.hs_int_start_stop_x			= 0x008D034E,
+	.hs_ext_start_stop_x			= 0x000F0359,
+	.vs_int_start_x				= 0x01A00000,
+	.vs_int_stop_x__vs_int_start_y		= 0x020501A0,
+	.vs_int_stop_y__vs_ext_start_x		= 0x01AC0024,
+	.vs_ext_stop_x__vs_ext_start_y		= 0x020D01AC,
+	.vs_ext_stop_y				= 0x00000006,
+	.avid_start_stop_x			= 0x03480079,
+	.avid_start_stop_y			= 0x02040024,
+	.fid_int_start_x__fid_int_start_y	= 0x0001008A,
+	.fid_int_offset_y__fid_ext_start_x	= 0x01AC0106,
+	.fid_ext_start_y__fid_ext_offset_y	= 0x01060006,
+	.tvdetgp_int_start_stop_x		= 0x00140001,
+	.tvdetgp_int_start_stop_y		= 0x00010001,
+	.gen_ctrl				= 0x00FF0000,
+	.output_control				= 0x0000000D,
+	.dac_b__dac_c				= 0x00000000
+};
+
+/*
+ * Configure Timings for DVI D
+ */
+static const struct panel_config dvid_cfg = {
+	.timing_h	= 0x0ff03f31, /* Horizantal timing */
+	.timing_v	= 0x01400504, /* Vertical timing */
+	.pol_freq	= 0x00007028, /* Pol Freq */
+	.divisor	= 0x00010006, /* 72Mhz Pixel Clock */
+	.lcd_size	= 0x02ff03ff, /* 1024x768 */
+	.panel_type	= 0x01, /* TFT */
+	.data_lines	= 0x03, /* 24 Bit RGB */
+	.load_mode	= 0x02, /* Frame Mode */
+	.panel_color	= DVI_BEAGLE_ORANGE_COL /* ORANGE */
+};
+
+static const struct panel_config dvid_cfg_xm = {
+	.timing_h	= 0x1a4024c9, /* Horizantal timing */
+	.timing_v	= 0x02c00509, /* Vertical timing */
+	.pol_freq	= 0x00007028, /* Pol Freq */
+	.divisor	= 0x00010001, /* 96MHz Pixel Clock */
+	.lcd_size	= 0x02ff03ff, /* 1024x768 */
+	.panel_type	= 0x01, /* TFT */
+	.data_lines	= 0x03, /* 24 Bit RGB */
+	.load_mode	= 0x02, /* Frame Mode */
+	.panel_color	= DVI_BEAGLE_ORANGE_COL /* ORANGE */
+};
 #endif
-- 
1.7.1

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-08-16  2:36 ` [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command Joel A Fernandes
@ 2011-09-08  6:13   ` Albert ARIBAUD
  2011-09-08  8:05   ` Wolfgang Denk
  1 sibling, 0 replies; 14+ messages in thread
From: Albert ARIBAUD @ 2011-09-08  6:13 UTC (permalink / raw)
  To: u-boot

Le 16/08/2011 04:36, Joel A Fernandes a ?crit :
> From: Jason Kridner<jkridner@beagleboard.org>
>
> Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072

Can(t find this one in my tree.

>      Author: Greg Turner<gregturner@ti.com>
>      Date:   Tue May 25 09:19:06 2010 -0500
>
>      New u-boot command for status of USER button on BeagleBoard-xM
>
>           Modified bootcmd to check the staus at boot time and set
> 	 filename of the boot script.

Generally speaking, is a 'userbutton' command' really needed when a gpio 
command exists? The notion of 'user button' isn't really something 
fundamentally meaningful to a bootloader -- We don't have a concept of 
'user', even.

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-08-16  2:36 ` [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command Joel A Fernandes
  2011-09-08  6:13   ` Albert ARIBAUD
@ 2011-09-08  8:05   ` Wolfgang Denk
  2011-09-08 14:56     ` Joel A Fernandes
  2011-09-11 16:39     ` Joel A Fernandes
  1 sibling, 2 replies; 14+ messages in thread
From: Wolfgang Denk @ 2011-09-08  8:05 UTC (permalink / raw)
  To: u-boot

Dear Joel A Fernandes,

In message <1313462214-3716-2-git-send-email-agnel.joel@gmail.com> you wrote:
> From: Jason Kridner <jkridner@beagleboard.org>
> 
> Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
>     Author: Greg Turner <gregturner@ti.com>
>     Date:   Tue May 25 09:19:06 2010 -0500
> 
>     New u-boot command for status of USER button on BeagleBoard-xM
> 
>          Modified bootcmd to check the staus at boot time and set
> 	 filename of the boot script.
> 
> * Moved to a BeagleBoard specific file.
> * Removed changes to default boot command from adding userbutton
>   command.
> * Made to handle pre-xM boards.
> * Flipped polarity of the return value to avoid confusion.  Success (0)
>   is when the button is pressed.  Failure (1) is when the button is NOT
>   pressed.
> * Used latest revision getting function.
> * Used latest macros for board revision.
> * Added xM-C revision definition (optional, since it was default)
> * updated default configuration with UserButton functionality
>   * Added a separate bootenv variable to load a user defined .txt file
>   * Added an example, showing how a different environment file can be loaded with
>     the user button pressed

Your patch has a large number of cding style issues; please always
run checkpatch before submitting patches.


Also, I agree with Albert: there should be no need for a separate
userbutton command.

Please fix and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The average woman would rather have beauty than brains,  because  the
average man can see better than he can think.

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08  8:05   ` Wolfgang Denk
@ 2011-09-08 14:56     ` Joel A Fernandes
  2011-09-08 15:03       ` Albert ARIBAUD
  2011-09-11 16:39     ` Joel A Fernandes
  1 sibling, 1 reply; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-08 14:56 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 3:05 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Joel A Fernandes,
>
> In message <1313462214-3716-2-git-send-email-agnel.joel@gmail.com> you wrote:
>> From: Jason Kridner <jkridner@beagleboard.org>
>>
>> Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
>> ? ? Author: Greg Turner <gregturner@ti.com>
>> ? ? Date: ? Tue May 25 09:19:06 2010 -0500
>>
>> ? ? New u-boot command for status of USER button on BeagleBoard-xM
>>
..
>
> Also, I agree with Albert: there should be no need for a separate
> userbutton command.
>
> Please fix and resubmit.
>

If this patch is to be dropped, then I'm not sure why the need to resubmit?

Thanks,
Joel

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08 14:56     ` Joel A Fernandes
@ 2011-09-08 15:03       ` Albert ARIBAUD
  2011-09-08 15:10         ` Kridner, Jason
  0 siblings, 1 reply; 14+ messages in thread
From: Albert ARIBAUD @ 2011-09-08 15:03 UTC (permalink / raw)
  To: u-boot

Hi Joel,

Le 08/09/2011 16:56, Joel A Fernandes a ?crit :

>> Also, I agree with Albert: there should be no need for a separate
>> userbutton command.
>>
>> Please fix and resubmit.
>
> If this patch is to be dropped, then I'm not sure why the need to resubmit?

I gather the "resubmit" means "resubmit the patch set minus this patch 
and renumbered accordingly".

> Thanks,
> Joel

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08 15:03       ` Albert ARIBAUD
@ 2011-09-08 15:10         ` Kridner, Jason
  2011-09-08 15:27           ` Joel A Fernandes
                             ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Kridner, Jason @ 2011-09-08 15:10 UTC (permalink / raw)
  To: u-boot



On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:

> Hi Joel,
> 
> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
> 
>>> Also, I agree with Albert: there should be no need for a separate
>>> userbutton command.
>>> 
>>> Please fix and resubmit.
>> 
>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
> 
> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".

One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.

> 
>> Thanks,
>> Joel
> 
> Amicalement,
> -- 
> Albert.

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08 15:10         ` Kridner, Jason
@ 2011-09-08 15:27           ` Joel A Fernandes
  2011-09-09  1:41           ` Joel A Fernandes
  2011-09-09 17:00           ` Joel A Fernandes
  2 siblings, 0 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-08 15:27 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 10:10 AM, Kridner, Jason <jdk@ti.com> wrote:
>
>
> On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:
>
>> Hi Joel,
>>
>> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
>>
>>>> Also, I agree with Albert: there should be no need for a separate
>>>> userbutton command.
>>>>
>>>> Please fix and resubmit.
>>>
>>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
>>
>> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".
>
> One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.
>

Sounds like a good idea, I will work on this and submit a patch soon.

Thanks,
Joel

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08 15:10         ` Kridner, Jason
  2011-09-08 15:27           ` Joel A Fernandes
@ 2011-09-09  1:41           ` Joel A Fernandes
  2011-09-09 14:19             ` Jason Kridner
  2011-09-09 17:00           ` Joel A Fernandes
  2 siblings, 1 reply; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-09  1:41 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 10:10 AM, Kridner, Jason <jdk@ti.com> wrote:
>
>
> On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:
>
>> Hi Joel,
>>
>> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
>>
>>>> Also, I agree with Albert: there should be no need for a separate
>>>> userbutton command.
>>>>
>>>> Please fix and resubmit.
>>>
>>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
>>
>> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".
>
> One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.
>

Actually the functions in arch/arm/cpu/armv7/omap-common/gpio.c are
not compatible with the ones used by common/cmd_led.c

What would be the right place to implement the required functions for
the gpio command?

1. In the (beagle)board file as wrappers to the omap gpio functions
2. In the gpio.c file in omap-common
3. Any other option?

Thanks,
Joel

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-09  1:41           ` Joel A Fernandes
@ 2011-09-09 14:19             ` Jason Kridner
  2011-09-09 15:31               ` Joel A Fernandes
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Kridner @ 2011-09-09 14:19 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 9:41 PM, Joel A Fernandes <agnel.joel@gmail.com> wrote:
> On Thu, Sep 8, 2011 at 10:10 AM, Kridner, Jason <jdk@ti.com> wrote:
>>
>>
>> On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:
>>
>>> Hi Joel,
>>>
>>> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
>>>
>>>>> Also, I agree with Albert: there should be no need for a separate
>>>>> userbutton command.
>>>>>
>>>>> Please fix and resubmit.
>>>>
>>>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
>>>
>>> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".
>>
>> One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.
>>
>
> Actually the functions in arch/arm/cpu/armv7/omap-common/gpio.c are
> not compatible with the ones used by common/cmd_led.c

The patches from Sanjeev Premi seemed to me to handle the deltas.  Are
you applying those?  They are working for me for use with the led
command.

>
> What would be the right place to implement the required functions for
> the gpio command?
>
> 1. In the (beagle)board file as wrappers to the omap gpio functions
> 2. In the gpio.c file in omap-common
> 3. Any other option?

Do you mean to replace userbutton?  As long as the gpio command
returns a status, then you should be able to remove userbutton from
the board.c file and add usage of gpio to replace userbutton in the
omap3_beagle.h config header file.  (Of course, the patches should
apply those changes in opposite order to make sure git bisect doesn't
show breakage.)

If you are saying that gpio.c is missing functionality, please
describe the missing functionality.

>
> Thanks,
> Joel
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-09 14:19             ` Jason Kridner
@ 2011-09-09 15:31               ` Joel A Fernandes
  0 siblings, 0 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-09 15:31 UTC (permalink / raw)
  To: u-boot

On Fri, Sep 9, 2011 at 9:19 AM, Jason Kridner <jkridner@beagleboard.org> wrote:
> On Thu, Sep 8, 2011 at 9:41 PM, Joel A Fernandes <agnel.joel@gmail.com> wrote:
>> On Thu, Sep 8, 2011 at 10:10 AM, Kridner, Jason <jdk@ti.com> wrote:
>>>
>>>
>>> On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:
>>>
>>>> Hi Joel,
>>>>
>>>> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
>>>>
>>>>>> Also, I agree with Albert: there should be no need for a separate
>>>>>> userbutton command.
>>>>>>
>>>>>> Please fix and resubmit.
>>>>>
>>>>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
>>>>
>>>> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".
>>>
>>> One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.
>>>
>>
>> Actually the functions in arch/arm/cpu/armv7/omap-common/gpio.c are
>> not compatible with the ones used by common/cmd_led.c
>
> The patches from Sanjeev Premi seemed to me to handle the deltas. ?Are
> you applying those? ?They are working for me for use with the led
> command.
>

I missed those patches! I have updated my tree and can see them now, thanks.

Regards,
Joel

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08 15:10         ` Kridner, Jason
  2011-09-08 15:27           ` Joel A Fernandes
  2011-09-09  1:41           ` Joel A Fernandes
@ 2011-09-09 17:00           ` Joel A Fernandes
  2 siblings, 0 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-09 17:00 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 10:10 AM, Kridner, Jason <jdk@ti.com> wrote:
>
>
> On Sep 8, 2011, at 11:03 AM, "Albert ARIBAUD" <albert.u.boot@aribaud.net> wrote:
>
>> Hi Joel,
>>
>> Le 08/09/2011 16:56, Joel A Fernandes a ?crit :
>>
>>>> Also, I agree with Albert: there should be no need for a separate
>>>> userbutton command.
>>>>
>>>> Please fix and resubmit.
>>>
>>> If this patch is to be dropped, then I'm not sure why the need to resubmit?
>>
>> I gather the "resubmit" means "resubmit the patch set minus this patch and renumbered accordingly".
>
> One thing that would be necessary is to replace the default bootcmd with one that uses the gpio command and to enable the gpio command.
>

One of the difficulties with this is the GPIO value for userbutton
depends on the board rev which is what your patch does. Hardcoding
gpio values for one will break support for other boards

Without adding any additional commands, the only way I see this can be done is:
1. Use the gpio and test commands to get the board rev in omap3_beagle.h
2. Based on this, use the right gpio value to pass to another gpio
command to check userbutton state

This is quite messy IMO and is redundant because the revision
detection logic is already in the board/ file.

Another way is to add a command to the board/ file like
"get_userbutton_gpio" and use the value it returns to pass to the gpio
command but this seems to defeat the purpose of the cleanup itself.

If you think one of the above methods is acceptable, please ACK them
and I will start developing the patch.

Thanks,
Joel

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

* [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command
  2011-09-08  8:05   ` Wolfgang Denk
  2011-09-08 14:56     ` Joel A Fernandes
@ 2011-09-11 16:39     ` Joel A Fernandes
  1 sibling, 0 replies; 14+ messages in thread
From: Joel A Fernandes @ 2011-09-11 16:39 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 8, 2011 at 3:05 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Joel A Fernandes,
>
> In message <1313462214-3716-2-git-send-email-agnel.joel@gmail.com> you wrote:
>> From: Jason Kridner <jkridner@beagleboard.org>
>>
>> Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
>> ? ? Author: Greg Turner <gregturner@ti.com>
>> ? ? Date: ? Tue May 25 09:19:06 2010 -0500
>>
>> ? ? New u-boot command for status of USER button on BeagleBoard-xM
>>
>> ? ? ? ? ?Modified bootcmd to check the staus at boot time and set
>> ? ? ? ?filename of the boot script.
>>
>> * Moved to a BeagleBoard specific file.
>> * Removed changes to default boot command from adding userbutton
>> ? command.
>> * Made to handle pre-xM boards.
>> * Flipped polarity of the return value to avoid confusion. ?Success (0)
>> ? is when the button is pressed. ?Failure (1) is when the button is NOT
>> ? pressed.
>> * Used latest revision getting function.
>> * Used latest macros for board revision.
>> * Added xM-C revision definition (optional, since it was default)
>> * updated default configuration with UserButton functionality
>> ? * Added a separate bootenv variable to load a user defined .txt file
>> ? * Added an example, showing how a different environment file can be loaded with
>> ? ? the user button pressed
>
> Your patch has a large number of cding style issues; please always
> run checkpatch before submitting patches.

Very sorry, I might have missed running it on this patch. I will
correct it and resubmit it

>
> Also, I agree with Albert: there should be no need for a separate
> userbutton command.
>
> Please fix and resubmit.

Sure. Thanks,
Joel

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

end of thread, other threads:[~2011-09-11 16:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16  2:36 [U-Boot] [PATCH 1/3] BeagleBoard: turn off clocks in ehci_stop Joel A Fernandes
2011-08-16  2:36 ` [U-Boot] [PATCH 2/3] BeagleBoard: Added userbutton command Joel A Fernandes
2011-09-08  6:13   ` Albert ARIBAUD
2011-09-08  8:05   ` Wolfgang Denk
2011-09-08 14:56     ` Joel A Fernandes
2011-09-08 15:03       ` Albert ARIBAUD
2011-09-08 15:10         ` Kridner, Jason
2011-09-08 15:27           ` Joel A Fernandes
2011-09-09  1:41           ` Joel A Fernandes
2011-09-09 14:19             ` Jason Kridner
2011-09-09 15:31               ` Joel A Fernandes
2011-09-09 17:00           ` Joel A Fernandes
2011-09-11 16:39     ` Joel A Fernandes
2011-08-16  2:36 ` [U-Boot] [PATCH 3/3] BeagleBoard: Configure DVI/S-video Joel A Fernandes

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.