mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] panda: misc patches
@ 2012-05-21 10:30 Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 1/4] panda: fix crash when not using barebox as second stage Anand Gadiyar
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Anand Gadiyar @ 2012-05-21 10:30 UTC (permalink / raw)
  To: barebox; +Cc: Anand Gadiyar

This series fixes a minor bug in the ehci initialization for panda
and enables i2c-omap, twlcore and LED support for the board.

This is my first patch posting to the barebox list and I hope I'll
have many more in future.

The patches are based on the -next branch, tested on an OMAP4430 panda.
Next up is to get OMAP4460/70 support.

Anand Gadiyar (4):
  panda: fix crash when not using barebox as second stage
  panda: add i2c and twlcore to panda
  panda: add LED support
  panda: update defconfig for i2c and led support

 arch/arm/boards/panda/board.c    |   33 +++++++++++++++++++++++++++++++++
 arch/arm/configs/panda_defconfig |    8 +++++++-
 2 files changed, 40 insertions(+), 1 deletions(-)


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/4] panda: fix crash when not using barebox as second stage
  2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
@ 2012-05-21 10:30 ` Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 2/4] panda: add i2c and twlcore to panda Anand Gadiyar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anand Gadiyar @ 2012-05-21 10:30 UTC (permalink / raw)
  To: barebox; +Cc: Anand Gadiyar

If barebox is not used as the MLO, then it crashes during boot
with the below error message:

Board: Texas Instrument's Panda
PandaBoard Revision: 003
omap-hsmmc@mci0: registered as mci0
unable to handle paging request at address 0x4a064010
pc : [<8f01e820>]    lr : [<8f0049a0>]
sp : 8cffff80  ip : 00000016  fp : 00100103
r10: 00000000  r9 : 00000ae7  r8 : 4030b76c
r7 : 40300200  r6 : e28f8028  r5 : 0000003e  r4 : 00000000
r3 : 4a064000  r2 : 00000014  r1 : 00000001  r0 : 00000001
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
[<8f01e820>] (panda_devices_init+0x17c/0x1e0) from [<8f006300>] (start_barebox+0x18/0x10c)
[<8f006300>] (start_barebox+0x18/0x10c) from [<8200006c>] (0x8200006c)

[<8f021248>] (unwind_backtrace+0x0/0x98) from [<8f011a00>] (panic+0x28/0x3c)
[<8f011a00>] (panic+0x28/0x3c) from [<8f02171c>] (do_exception+0x10/0x14)
[<8f02171c>] (do_exception+0x10/0x14) from [<8f021784>] (do_data_abort+0x2c/0x38)
[<8f021784>] (do_data_abort+0x2c/0x38) from [<8f021470>] (data_abort+0x50/0x60)

This is because the USBHOST module is not enabled. The module enable
is is normally done in mach-omap/xload.c which never gets called.

Since we're configuring the USBHOST CLKCTRL register in the board file
anyway, we might as well explicitly enable the module in the same place.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
Steps to reproduce:
Download and build usbboot from here:
git://git.omapzoom.org/repo/omapboot.git

Check out and build the p-master branch.
  make ARCH=omap4 BOARD=panda

Then you can do a USB boot using
usbboot barebox.bin

 arch/arm/boards/panda/board.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 628d3f1..26d365c 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -78,6 +78,7 @@ static void panda_ehci_init(void)
 	gpio_set_value(hub_nreset, 1);
 	val = readl(0x4a009358);
 	val |= (1 << 24);
+	val |= 0x2;
 	writel(val, 0x4a009358);
 	writel(0x7, 0x4a008180);
 	mdelay(10);
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/4] panda: add i2c and twlcore to panda
  2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 1/4] panda: fix crash when not using barebox as second stage Anand Gadiyar
@ 2012-05-21 10:30 ` Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 3/4] panda: add LED support Anand Gadiyar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anand Gadiyar @ 2012-05-21 10:30 UTC (permalink / raw)
  To: barebox; +Cc: Anand Gadiyar

Add i2c-omap and twlcore driver to panda board.
(Based on similar patch for pcm049).

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
Tested on OMAP4430 Pandaboard

 arch/arm/boards/panda/board.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 26d365c..fcca5dd 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -20,6 +20,7 @@
 #include <mach/gpio.h>
 #include <environment.h>
 #include <mach/xload.h>
+#include <i2c/i2c.h>
 
 static int board_revision;
 
@@ -106,6 +107,12 @@ static void __init panda_boardrev_init(void)
 	pr_info("PandaBoard Revision: %03d\n", board_revision);
 }
 
+static struct i2c_board_info i2c_devices[] = {
+	{
+		I2C_BOARD_INFO("twl6030", 0x48),
+	},
+};
+
 static int panda_devices_init(void)
 {
 	panda_boardrev_init();
@@ -134,6 +141,12 @@ static int panda_devices_init(void)
 		sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);
 	}
 
+	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
+	add_generic_device("i2c-omap", DEVICE_ID_DYNAMIC,
+				NULL, 0x48070000, 0x1000,
+				IORESOURCE_MEM, NULL);
+
+
 	add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, 0x4809C100, SZ_4K,
 			   IORESOURCE_MEM, NULL);
 	panda_ehci_init();
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/4] panda: add LED support
  2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 1/4] panda: fix crash when not using barebox as second stage Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 2/4] panda: add i2c and twlcore to panda Anand Gadiyar
@ 2012-05-21 10:30 ` Anand Gadiyar
  2012-05-21 10:30 ` [PATCH 4/4] panda: update defconfig for i2c and led support Anand Gadiyar
  2012-05-21 19:42 ` [PATCH 0/4] panda: misc patches Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Anand Gadiyar @ 2012-05-21 10:30 UTC (permalink / raw)
  To: barebox; +Cc: Anand Gadiyar

Register GPIO7 as heartbeat LED, same as in the linux kernel.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
 arch/arm/boards/panda/board.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index fcca5dd..84b4ecd 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -21,6 +21,8 @@
 #include <environment.h>
 #include <mach/xload.h>
 #include <i2c/i2c.h>
+#include <gpio.h>
+#include <led.h>
 
 static int board_revision;
 
@@ -113,6 +115,22 @@ static struct i2c_board_info i2c_devices[] = {
 	},
 };
 
+struct gpio_led panda_leds[] = {
+	{
+		.gpio = 7,
+		.led = {
+			.name = "heartbeat",
+		},
+	},
+};
+
+static void panda_led_init(void)
+{
+	gpio_direction_output(7, 0);
+	led_gpio_register(&panda_leds[0]);
+	led_set_trigger(LED_TRIGGER_HEARTBEAT, &panda_leds[0].led);
+}
+
 static int panda_devices_init(void)
 {
 	panda_boardrev_init();
@@ -151,6 +169,7 @@ static int panda_devices_init(void)
 			   IORESOURCE_MEM, NULL);
 	panda_ehci_init();
 
+	panda_led_init();
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_OMAP4_PANDA);
 
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/4] panda: update defconfig for i2c and led support
  2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
                   ` (2 preceding siblings ...)
  2012-05-21 10:30 ` [PATCH 3/4] panda: add LED support Anand Gadiyar
@ 2012-05-21 10:30 ` Anand Gadiyar
  2012-05-21 19:42 ` [PATCH 0/4] panda: misc patches Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Anand Gadiyar @ 2012-05-21 10:30 UTC (permalink / raw)
  To: barebox; +Cc: Anand Gadiyar

Enable I2C and LED support in defconfig.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
 arch/arm/configs/panda_defconfig |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/panda_defconfig b/arch/arm/configs/panda_defconfig
index 68cc11e..0b2d423 100644
--- a/arch/arm/configs/panda_defconfig
+++ b/arch/arm/configs/panda_defconfig
@@ -19,7 +19,6 @@ CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/panda/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_LOADENV=y
 CONFIG_CMD_EXPORT=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_READLINE=y
@@ -43,6 +42,8 @@ CONFIG_CMD_MAGICVAR=y
 CONFIG_CMD_MAGICVAR_HELP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_LED=y
 CONFIG_NET=y
 CONFIG_NET_DHCP=y
 CONFIG_NET_NFS=y
@@ -54,11 +55,16 @@ CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
 CONFIG_NET_USB=y
 CONFIG_NET_USB_SMSC95XX=y
 # CONFIG_SPI is not set
+CONFIG_I2C=y
+CONFIG_I2C_OMAP=y
 CONFIG_USB=y
 CONFIG_USB_EHCI=y
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 CONFIG_MCI_OMAP_HSMMC=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_TRIGGERS=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
 CONFIG_FS_FAT_LFN=y
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 0/4] panda: misc patches
  2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
                   ` (3 preceding siblings ...)
  2012-05-21 10:30 ` [PATCH 4/4] panda: update defconfig for i2c and led support Anand Gadiyar
@ 2012-05-21 19:42 ` Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-05-21 19:42 UTC (permalink / raw)
  To: Anand Gadiyar; +Cc: barebox

Hi Anand,

On Mon, May 21, 2012 at 04:00:09PM +0530, Anand Gadiyar wrote:
> This series fixes a minor bug in the ehci initialization for panda
> and enables i2c-omap, twlcore and LED support for the board.
> 
> This is my first patch posting to the barebox list and I hope I'll
> have many more in future.
> 
> The patches are based on the -next branch, tested on an OMAP4430 panda.
> Next up is to get OMAP4460/70 support.

Cool, looking forward to this ;)

> 
> Anand Gadiyar (4):
>   panda: fix crash when not using barebox as second stage

Applied this one to master...

>   panda: add i2c and twlcore to panda
>   panda: add LED support
>   panda: update defconfig for i2c and led support

And the rest to next.

Thanks
 Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-05-21 19:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
2012-05-21 10:30 ` [PATCH 1/4] panda: fix crash when not using barebox as second stage Anand Gadiyar
2012-05-21 10:30 ` [PATCH 2/4] panda: add i2c and twlcore to panda Anand Gadiyar
2012-05-21 10:30 ` [PATCH 3/4] panda: add LED support Anand Gadiyar
2012-05-21 10:30 ` [PATCH 4/4] panda: update defconfig for i2c and led support Anand Gadiyar
2012-05-21 19:42 ` [PATCH 0/4] panda: misc patches Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox