Skip to contentSkip to conversation

ARM: DRA7XX: Add config file for Android with fastboot support

PATCH Superseded Dileep Katta 8 participants 49 messages Mar 3, 2015 – Apr 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313 +++++++++++++++++++++++++++++++++++
 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h
arch/arm/cpu/armv7/omap5/Kconfig +5 -0
index aca862d..d8e9b2d 100644
@@ -12,6 +12,11 @@ config TARGET_OMAP5_UEVM
 config TARGET_DRA7XX_EVM
 	bool "TI DRA7XX"
 
+config TARGET_DRA7XX_EVM_ANDROID
+	bool "TI DRA7XX ANDROID"
+	---help---
+	TI DRA7XX build for Android. Enables Fastboot.
+
 config TARGET_BEAGLE_X15
 	bool "BeagleBoard X15"
 
board/ti/dra7xx/Kconfig +13 -0
index 3bbd866..6837998 100644
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
 	default "dra7xx_evm"
 
 endif
+
+if TARGET_DRA7XX_EVM_ANDROID
+
+config SYS_BOARD
+	default "dra7xx"
+
+config SYS_VENDOR
+	default "ti"
+
+config SYS_CONFIG_NAME
+	default "dra7xx_evm_android"
+
+endif
board/ti/dra7xx/MAINTAINERS +2 -0
index 5ec6769..efd4f81 100644
@@ -6,3 +6,5 @@ F:	include/configs/dra7xx_evm.h
 F:	configs/dra7xx_evm_defconfig
 F:	configs/dra7xx_evm_qspiboot_defconfig
 F:	configs/dra7xx_evm_uart3_defconfig
+F:	include/configs/dra7xx_evm_android.h
+F:	configs/dra7xx_evm_android_defconfig
configs/dra7xx_evm_android_defconfig new file +5 -0
new file mode 100644
index 0000000..64ae4b3
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
++S:CONFIG_ARM=y
++S:CONFIG_OMAP54XX=y
++S:CONFIG_TARGET_DRA7XX_EVM_ANDROID=y
include/configs/dra7xx_evm_android.h new file +313 -0

313 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#1 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c +2 -0
index 346ab80..d7b8f6d 100644
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
 	int ret;
 
+	board_usb_init(0, USB_INIT_DEVICE);
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
 	if (ret)
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Hi Dileep,

Quoted 18 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c +0 -0
index 346ab80..d7b8f6d 100644
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>

common/cmd_fastboot.c line 22

Quoted 10 lines
common/cmd_fastboot.c +2 -0
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
 	int ret;
 
+	board_usb_init(0, USB_INIT_DEVICE);
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
 	if (ret)
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#3 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

In reply to Dileep Katta

Hi Dileep,

Quoted 25 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to enable usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c index renamed from common/cmd_fastboot.c +0 -0

346ab80..d7b8f6d 100644

common/cmd_fastboot.c line 19

Quoted 10 lines
common/cmd_fastboot.c +2 -0
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const
 argv[])  {
 	int ret;
 
+	board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable. Also, should board_usb_cleanup be called at the end?

Thanks,
Angela

Quoted 5 lines
common/cmd_fastboot.c +0 -1
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
 	if (ret)
--

1.8.3.2

#4 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 32 lines · Angela

Hi Dileep,

Quoted 30 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to enable usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c index renamed from common/cmd_fastboot.c +0 -0

346ab80..d7b8f6d 100644

common/cmd_fastboot.c +1 -0
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
Quoted 7 lines

common/cmd_fastboot.c line 19

Quoted 5 lines
common/cmd_fastboot.c +1 -0
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const
 argv[])  {
 	int ret;
 
+	board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable. Also, should board_usb_cleanup be called at the end?

I _really_ _really_ want to see if we can modify things so that we don't have to sprinkle ever gadget driver with a cleanup() and every gadget too if we don't have to. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150304/78047300/attachment.sig>
#5 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 39 lines · Tom Rini
Quoted 10 lines · Angela

Hi Dileep,

Quoted 8 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to

enable

Quoted 22 lines
Quoted 22 lines

usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c index renamed from common/cmd_fastboot.c +0 -0

346ab80..d7b8f6d 100644

common/cmd_fastboot.c +1 -0
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
Quoted 1 line

common/cmd_fastboot.c line 15

Quoted 1 line
common/cmd_fastboot.c +0 -0
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char

*const

Quoted 3 lines
Quoted 3 lines
common/cmd_fastboot.c +0 -0
 argv[])  {
    int ret;
 
Quoted 9 lines
Quoted 3 lines

common/cmd_fastboot.c line 19

Quoted 1 line
common/cmd_fastboot.c +1 -0
+   board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable. Also, should

board_usb_cleanup be called at the end?

I _really_ _really_ want to see if we can modify things so that we don't have to sprinkle ever gadget driver with a cleanup() and every gadget too if we don't have to. Thanks!

Most of the boards have board_usb_cleanup() as just a stub. For some, the function is not present, and adding board_usb_cleanup() here breaks the build for others with fastboot enabled.

Quoted 4 lines

--
Tom

Regards, Dileep

#6 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 46 lines · Dileep Katta
Quoted 44 lines · Tom Rini
Quoted 10 lines · Angela

Hi Dileep,

Quoted 8 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to

enable

Quoted 22 lines
Quoted 22 lines

usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c index renamed from common/cmd_fastboot.c +0 -0

346ab80..d7b8f6d 100644

common/cmd_fastboot.c +1 -0
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
Quoted 1 line

common/cmd_fastboot.c line 15

Quoted 1 line
common/cmd_fastboot.c +0 -0
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char

*const

Quoted 6 lines

common/cmd_fastboot.c line 19

Quoted 4 lines
common/cmd_fastboot.c +1 -0
 argv[])  {
    int ret;
 
+   board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable. Also, should

board_usb_cleanup be called at the end?

Quoted 7 lines
Quoted 3 lines

I _really_ _really_ want to see if we can modify things so that we don't have to sprinkle ever gadget driver with a cleanup() and every gadget too if we don't have to. Thanks!

Most of the boards have board_usb_cleanup() as just a stub. For some, the function is not present, and adding board_usb_cleanup() here breaks the build for others with fastboot enabled.

That's a problem that needs fixing since those boards without a functional board_usb_cleanup() are likely causing breakage in Linux.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150305/a10609de/attachment.sig>
#7 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 37 lines · Tom Rini
Quoted 36 lines · Dileep Katta
Quoted 34 lines · Tom Rini
Quoted 10 lines · Angela

Hi Dileep,

Quoted 8 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to

enable

Quoted 22 lines
Quoted 22 lines

usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c index renamed from common/cmd_fastboot.c +0 -0

346ab80..d7b8f6d 100644

common/cmd_fastboot.c +1 -0
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

common/cmd_fastboot.c line 15

Quoted 1 line
common/cmd_fastboot.c +0 -0
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char

*const

Quoted 6 lines

common/cmd_fastboot.c line 19

Quoted 4 lines
common/cmd_fastboot.c +1 -0
 argv[])  {
    int ret;
 
+   board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable.

We are not getting controller Index as an argument for fastboot function. Might have to add extra logic to get the same.
But do we need configurable index here for fastboot?
Experts, please advise.

Quoted 8 lines

Also, should

Quoted 3 lines
Quoted 3 lines

board_usb_cleanup be called at the end?

I _really_ _really_ want to see if we can modify things so that we

don't

Quoted 3 lines
Quoted 2 lines

have to sprinkle ever gadget driver with a cleanup() and every gadget too if we don't have to. Thanks!

Quoted 7 lines
Quoted 3 lines

Most of the boards have board_usb_cleanup() as just a stub. For some, the function is not present, and adding board_usb_cleanup() here breaks the build for others with fastboot enabled.

That's a problem that needs fixing since those boards without a functional board_usb_cleanup() are likely causing breakage in Linux.

Will add the board_usb_cleanup() function at the end.

Quoted 4 lines

--
Tom

#8 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Hi Dileep, Marek

Quoted 47 lines · Tom Rini
Quoted 46 lines · Dileep Katta
Quoted 44 lines · Tom Rini
Quoted 43 lines
Quoted 11 lines · Angela

Hi Dileep,

Quoted 9 lines

-----Original Message-----
From: Dileep Katta [mailto:dileep.katta at linaro.org]
Sent: Tuesday, March 03, 2015 5:11 AM
To: u-boot at lists.denx.de; robherring2 at gmail.com; Rini, Tom; rob.herring at linaro.org; srae at broadcom.com; l.majewski at samsung.com; Stegmaier, Angela
Cc: Dileep Katta
Subject: [U-Boot][PATCH v2 2/4] fastboot: call board_usb_init() to

enable

Quoted 22 lines
Quoted 22 lines

usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot.
Calling board_usb_init() fixes this.

---
 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)
common/cmd_fastboot.c +1 -0
index 346ab80..d7b8f6d 100644
@@ -10,11 +10,13 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
Quoted 2 lines
Quoted 2 lines
common/cmd_fastboot.c +0 -0
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int

argc, char

*const

Quoted 3 lines
Quoted 3 lines
argv[])  {
    int ret;
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

+ board_usb_init(0, USB_INIT_DEVICE);

The controller index should be configurable.

We are not getting controller Index as an argument for fastboot function. Might have to add extra logic to get the same. But do we need configurable index here for fastboot? Experts, please advise.

Some time ago we have changed syntax of all gadget related commands (from e.g. dfu mmc 0 -> dfu 0 mmc 0) to support different controllers. Rationale was to prepare ourself for future changes.

IMHO it would be feasible to do the same with fastboot command. However, lets wait for Marek's opinion.

Quoted 10 lines
Quoted 10 lines

Also, should

Quoted 4 lines
Quoted 4 lines

board_usb_cleanup be called at the end?

I _really_ _really_ want to see if we can modify things so that we

don't

Quoted 3 lines
Quoted 2 lines

have to sprinkle ever gadget driver with a cleanup() and every gadget too if we don't have to. Thanks!

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Most of the boards have board_usb_cleanup() as just a stub. For some, the function is not present, and adding board_usb_cleanup() here breaks the build for others with fastboot enabled.

That's a problem that needs fixing since those boards without a functional board_usb_cleanup() are likely causing breakage in Linux.

Will add the board_usb_cleanup() function at the end.

+1

Quoted 5 lines
Quoted 5 lines

--
Tom

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#9 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

On Thursday, March 12, 2015 at 09:55:57 AM, Lukasz Majewski wrote:

Hi!

[...]

Quoted 11 lines
Quoted 4 lines

We are not getting controller Index as an argument for fastboot function. Might have to add extra logic to get the same. But do we need configurable index here for fastboot? Experts, please advise.

Some time ago we have changed syntax of all gadget related commands (from e.g. dfu mmc 0 -> dfu 0 mmc 0) to support different controllers. Rationale was to prepare ourself for future changes.

IMHO it would be feasible to do the same with fastboot command. However, lets wait for Marek's opinion.

I'm all for that.

Best regards,
Marek Vasut

#10 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this.
fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

	https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +12 -3
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
 	int ret;
+	int controller_index = 0;
 
+	if (argc == 2) {
+		char *usb_controller = argv[1];
+		controller_index = simple_strtoul(usb_controller, NULL, 0);
+	}
+
+	board_usb_init(controller_index, USB_INIT_DEVICE);
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
 	if (ret)
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 
 	g_dnl_unregister();
 	g_dnl_clear_detach();
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);
 	return CMD_RET_SUCCESS;
 }
 
 U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot,	2,	0,	do_fastboot,
 	"use USB Fastboot protocol",
-	"\n"
-	"    - run as a fastboot usb device"
+	"[<USB_controller>]\n"
+	"    - run as a fastboot usb device via <USB_controller>"
 );
Signature · 1 line
1.8.3.2
#11 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Hi Dileep,

Quoted 52 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller
index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

	https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +8 -0
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
 	int ret;
+	int controller_index = 0;
 
+	if (argc == 2) {
+		char *usb_controller = argv[1];
+		controller_index = simple_strtoul(usb_controller,
 NULL, 0);
+	}
+
+	board_usb_init(controller_index, USB_INIT_DEVICE);
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_fastboot");
common/cmd_fastboot.c +1 -0
 	if (ret)
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[]) 
 	g_dnl_unregister();
 	g_dnl_clear_detach();
+	board_usb_cleanup(controller_index, USB_INIT_DEVICE);
 	return CMD_RET_SUCCESS;
 }

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int · line 56

Quoted 10 lines
common/cmd_fastboot.c +3 -3
 
 U_BOOT_CMD(
-	fastboot,	1,	0,	do_fastboot,
+	fastboot,	2,	0,	do_fastboot,
 	"use USB Fastboot protocol",
-	"\nLukasz Majewski <[email protected]>"
-	"    - run as a fastboot usb device"
+	"[<USB_controller>]\n"
+	"    - run as a fastboot usb device via <USB_controller>"
 );

Since I'm not CC'ed to all patches, I assume that this work would go via other tree?

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#12 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Hi Lukasz,

Quoted 67 lines · Lukasz Majewski

Hi Dileep,

Quoted 52 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller
index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

      https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +8 -0
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
      int ret;
+     int controller_index = 0;
 
+     if (argc == 2) {
+             char *usb_controller = argv[1];
+             controller_index = simple_strtoul(usb_controller,
 NULL, 0);
+     }
+
+     board_usb_init(controller_index, USB_INIT_DEVICE);
      g_dnl_clear_detach();
      ret = g_dnl_register("usb_dnl_fastboot");

if (ret)

common/cmd_fastboot.c +1 -0
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[])
      g_dnl_unregister();
      g_dnl_clear_detach();
+     board_usb_cleanup(controller_index, USB_INIT_DEVICE);
      return CMD_RET_SUCCESS;
 }

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int · line 56

Quoted 10 lines
common/cmd_fastboot.c +3 -3
 
 U_BOOT_CMD(
-     fastboot,       1,      0,      do_fastboot,
+     fastboot,       2,      0,      do_fastboot,
      "use USB Fastboot protocol",
-     "\nLukasz Majewski <[email protected]>"
-     "    - run as a fastboot usb device"
+     "[<USB_controller>]\n"
+     "    - run as a fastboot usb device via <USB_controller>"
 );
Quoted 3 lines

Since I'm not CC'ed to all patches, I assume that this work would go via other tree?

Other patches are TI board specific and I am working on next version of the patches as per the review comments.
I felt that this is generic functionality and hence sent it separately. Do you want me send all patches?

Regards, Dileep

Quoted 8 lines

--
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

#13 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 72 lines · On Sat, 14 Mar 2015 00:58:51 +0530 Dileep Katta <[email protected]> wrote:

Hi Lukasz,

Quoted 67 lines · Lukasz Majewski

Hi Dileep,

Quoted 52 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller
index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

      https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +8 -0
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
      int ret;
+     int controller_index = 0;
 
+     if (argc == 2) {
+             char *usb_controller = argv[1];
+             controller_index = simple_strtoul(usb_controller,
 NULL, 0);
+     }
+
+     board_usb_init(controller_index, USB_INIT_DEVICE);
      g_dnl_clear_detach();
      ret = g_dnl_register("usb_dnl_fastboot");

if (ret)

common/cmd_fastboot.c +1 -0
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[])
      g_dnl_unregister();
      g_dnl_clear_detach();
+     board_usb_cleanup(controller_index, USB_INIT_DEVICE);
      return CMD_RET_SUCCESS;
 }

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int · line 56

Quoted 10 lines
common/cmd_fastboot.c +3 -3
 
 U_BOOT_CMD(
-     fastboot,       1,      0,      do_fastboot,
+     fastboot,       2,      0,      do_fastboot,
      "use USB Fastboot protocol",
-     "\nLukasz Majewski <[email protected]>"
-     "    - run as a fastboot usb device"
+     "[<USB_controller>]\n"
+     "    - run as a fastboot usb device via <USB_controller>"
 );
Quoted 7 lines
Quoted 3 lines

Since I'm not CC'ed to all patches, I assume that this work would go via other tree?

Other patches are TI board specific and I am working on next version of the patches as per the review comments.
I felt that this is generic functionality and hence sent it separately. Do you want me send all patches?

No, it is not necessary. Regarding above, I assume that Tom will probably fetch those patches.

I was just concern about tree to which this patch should belong.

Regards,
Lukasz

Quoted 7 lines

Regards, Dileep

Quoted 4 lines

--
Best regards,

Quoted 8 lines
Quoted 4 lines

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150313/0cb0630a/attachment.sig>

#14 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Experts,
Please send your valuable comments if this patch needs any change.

Regards, Dileep

Quoted 108 lines · Lukasz Majewski
Quoted 72 lines · On Sat, 14 Mar 2015 00:58:51 +0530 Dileep Katta <[email protected]> wrote:

Hi Lukasz,

Quoted 67 lines · Lukasz Majewski

Hi Dileep,

Quoted 52 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller
index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

      https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +8 -0
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
      int ret;
+     int controller_index = 0;
 
+     if (argc == 2) {
+             char *usb_controller = argv[1];
+             controller_index = simple_strtoul(usb_controller,
 NULL, 0);
+     }
+
+     board_usb_init(controller_index, USB_INIT_DEVICE);
      g_dnl_clear_detach();
      ret = g_dnl_register("usb_dnl_fastboot");

if (ret)

common/cmd_fastboot.c +1 -0
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[])
      g_dnl_unregister();
      g_dnl_clear_detach();
+     board_usb_cleanup(controller_index, USB_INIT_DEVICE);
      return CMD_RET_SUCCESS;
 }

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int · line 56

Quoted 10 lines
common/cmd_fastboot.c +3 -3
 
 U_BOOT_CMD(
-     fastboot,       1,      0,      do_fastboot,
+     fastboot,       2,      0,      do_fastboot,
      "use USB Fastboot protocol",
-     "\nLukasz Majewski <[email protected]>"
-     "    - run as a fastboot usb device"
+     "[<USB_controller>]\n"
+     "    - run as a fastboot usb device via <USB_controller>"
 );
Quoted 7 lines
Quoted 3 lines

Since I'm not CC'ed to all patches, I assume that this work would go via other tree?

Other patches are TI board specific and I am working on next version of the patches as per the review comments.
I felt that this is generic functionality and hence sent it separately. Do you want me send all patches?

No, it is not necessary. Regarding above, I assume that Tom will probably fetch those patches.

I was just concern about tree to which this patch should belong.

Regards,
Lukasz

Quoted 15 lines

Regards, Dileep

Quoted 8 lines

--
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

#15 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 2 lines · Dileep Katta

Experts,
Please send your valuable comments if this patch needs any change.

Assuming everything has acks I'll pick it up for the next release, thanks.

Quoted 116 lines

Regards, Dileep

Quoted 83 lines · Lukasz Majewski
Quoted 72 lines · On Sat, 14 Mar 2015 00:58:51 +0530 Dileep Katta <[email protected]> wrote:

Hi Lukasz,

Quoted 67 lines · Lukasz Majewski

Hi Dileep,

Quoted 52 lines

g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index.

---
Changes in v2:
- Changed fastboot command to facilitate passing controller
index
- Added board_usb_cleanup()
This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform

      https://patchwork.ozlabs.org/patch/430303/
 common/cmd_fastboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
common/cmd_fastboot.c +8 -0
index 346ab80..9ca4a2f 100644
@@ -10,11 +10,19 @@
 #include <common.h>
 #include <command.h>
 #include <g_dnl.h>
+#include <usb.h>
 
 static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
      int ret;
+     int controller_index = 0;
 
+     if (argc == 2) {
+             char *usb_controller = argv[1];
+             controller_index = simple_strtoul(usb_controller,
 NULL, 0);
+     }
+
+     board_usb_init(controller_index, USB_INIT_DEVICE);
      g_dnl_clear_detach();
      ret = g_dnl_register("usb_dnl_fastboot");

if (ret)

common/cmd_fastboot.c +1 -0
@@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[])
      g_dnl_unregister();
      g_dnl_clear_detach();
+     board_usb_cleanup(controller_index, USB_INIT_DEVICE);
      return CMD_RET_SUCCESS;
 }

common/cmd_fastboot.c static int do_fastboot(cmd_tbl_t *cmdtp, int · line 56

Quoted 10 lines
common/cmd_fastboot.c +3 -3
 
 U_BOOT_CMD(
-     fastboot,       1,      0,      do_fastboot,
+     fastboot,       2,      0,      do_fastboot,
      "use USB Fastboot protocol",
-     "\nLukasz Majewski <[email protected]>"
-     "    - run as a fastboot usb device"
+     "[<USB_controller>]\n"
+     "    - run as a fastboot usb device via <USB_controller>"
 );
Quoted 7 lines
Quoted 3 lines

Since I'm not CC'ed to all patches, I assume that this work would go via other tree?

Other patches are TI board specific and I am working on next version of the patches as per the review comments.
I felt that this is generic functionality and hence sent it separately. Do you want me send all patches?

Quoted 25 lines

No, it is not necessary. Regarding above, I assume that Tom will probably fetch those patches.

I was just concern about tree to which this patch should belong.

Regards,
Lukasz

Quoted 15 lines

Regards, Dileep

Quoted 8 lines

--
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

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

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150327/772761df/attachment.sig>
#16 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Quoted 6 lines · Tom Rini
Quoted 2 lines · Dileep Katta

Experts,
Please send your valuable comments if this patch needs any change.

Assuming everything has acks I'll pick it up for the next release, thanks.

Lukasz can pick it through the correct tree for next release just fine I think.

Best regards,
Marek Vasut

#17 lore raw

PATCH v2 2/4 fastboot: call board_usb_init() to enable usb

Hi Marek,

Quoted 10 lines · Tom Rini
Quoted 6 lines · Dileep Katta
Quoted 2 lines

Experts,
Please send your valuable comments if this patch needs any change.

Assuming everything has acks I'll pick it up for the next release, thanks.

Lukasz can pick it through the correct tree for next release just fine I think.

And adding Lukasz to CC would really speed up the process :-)

Quoted 3 lines

Best regards,
Marek Vasut

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#18 lore raw

PATCH v3 3/4 ARM: DRA7: Set serial number environment variable

In reply to Dileep Katta

Adds the registers to get the serial number of dra7xx boards. Serial# environment variable will be set if not done already. This will be useful to show correct information in "fastboot devices" commands.

---
 arch/arm/cpu/armv7/omap5/prcm-regs.c |  2 ++
 arch/arm/include/asm/omap_common.h   |  2 ++
 board/ti/dra7xx/evm.c                | 11 +++++++++++
 3 files changed, 15 insertions(+)
arch/arm/cpu/armv7/omap5/prcm-regs.c +2 -0
index 0745d42..020a964 100644
@@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
 	.control_emif1_sdram_config_ext		= 0x4AE0C144,
 	.control_emif2_sdram_config_ext		= 0x4AE0C148,
 	.control_wkup_ldovbb_mpu_voltage_ctrl	= 0x4AE0C158,
+	.control_std_fuse_die_id_3		= 0x4AE0C210,
+	.control_std_fuse_prod_id_0		= 0x4AE0C214,
 	.control_padconf_mode			= 0x4AE0C5A0,
 	.control_xtal_oscillator		= 0x4AE0C5A4,
 	.control_i2c_2				= 0x4AE0C5A8,
arch/arm/include/asm/omap_common.h +2 -0
index 323952f..b329803 100644
@@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs {
 	u32 control_core_control_io1;
 	u32 control_core_control_io2;
 	u32 control_id_code;
+	u32 control_std_fuse_die_id_3;
+	u32 control_std_fuse_prod_id_0;
 	u32 control_std_fuse_opp_bgap;
 	u32 control_ldosram_iva_voltage_ctrl;
 	u32 control_ldosram_mpu_voltage_ctrl;
board/ti/dra7xx/evm.c +11 -0
index 6522241..e20d950 100644
@@ -88,10 +88,21 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	char serialno[72];
+	uint32_t serialno_lo, serialno_hi;
+
 	if (omap_revision() == DRA722_ES1_0)
 		setenv("board_name", "dra72x");
 	else
 		setenv("board_name", "dra7xx");
+
+	if (!getenv("serial#")) {
+		printf("serial# not set, setting...\n");
+		serialno_lo = readl((*ctrl)->control_std_fuse_die_id_3);
+		serialno_hi = readl((*ctrl)->control_std_fuse_prod_id_0);
+		sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
+		setenv("serial#", serialno);
+	}
 #endif
 	return 0;
 }
Signature · 1 line
1.8.3.2
#19 lore raw

PATCH v3 3/4 ARM: DRA7: Set serial number environment variable

Hi Dileep,

Quoted 65 lines

Adds the registers to get the serial number of dra7xx boards. Serial# environment variable will be set if not done already. This will be useful to show correct information in "fastboot devices" commands.

---
 arch/arm/cpu/armv7/omap5/prcm-regs.c |  2 ++
 arch/arm/include/asm/omap_common.h   |  2 ++
 board/ti/dra7xx/evm.c                | 11 +++++++++++
 3 files changed, 15 insertions(+)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap5/prcm-regs.c index 0745d42..020a964 100644

arch/arm/cpu/armv7/omap5/prcm-regs.c +2 -0
@@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
 	.control_emif1_sdram_config_ext		= 0x4AE0C144,
 	.control_emif2_sdram_config_ext		= 0x4AE0C148,
 	.control_wkup_ldovbb_mpu_voltage_ctrl	= 0x4AE0C158,
+	.control_std_fuse_die_id_3		= 0x4AE0C210,
+	.control_std_fuse_prod_id_0		= 0x4AE0C214,
 	.control_padconf_mode			= 0x4AE0C5A0,
 	.control_xtal_oscillator		= 0x4AE0C5A4,
 	.control_i2c_2				= 0x4AE0C5A8,
(quoted diff) +0 -0

b/arch/arm/include/asm/omap_common.h index 323952f..b329803 100644

arch/arm/include/asm/omap_common.h +2 -0
@@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs {
 	u32 control_core_control_io1;
 	u32 control_core_control_io2;
 	u32 control_id_code;
+	u32 control_std_fuse_die_id_3;
+	u32 control_std_fuse_prod_id_0;
 	u32 control_std_fuse_opp_bgap;
 	u32 control_ldosram_iva_voltage_ctrl;
 	u32 control_ldosram_mpu_voltage_ctrl;
board/ti/dra7xx/evm.c +11 -0
index 6522241..e20d950 100644
@@ -88,10 +88,21 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	char serialno[72];
+	uint32_t serialno_lo, serialno_hi;
+
 	if (omap_revision() == DRA722_ES1_0)
 		setenv("board_name", "dra72x");
 	else
 		setenv("board_name", "dra7xx");
+
+	if (!getenv("serial#")) {
+		printf("serial# not set, setting...\n");
+		serialno_lo =
 readl((*ctrl)->control_std_fuse_die_id_3);
+		serialno_hi =
 readl((*ctrl)->control_std_fuse_prod_id_0);
+		sprintf(serialno, "%08x%08x", serialno_hi,
 serialno_lo);
+		setenv("serial#", serialno);
+	}
Quoted 3 lines

#endif
return 0;
}

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#20 lore raw

PATCH v3 3/4 ARM: DRA7: Set serial number environment variable

In reply to Dileep Katta
Quoted 7 lines · Dileep Katta

Adds the registers to get the serial number of dra7xx boards. Serial# environment variable will be set if not done already. This will be useful to show correct information in "fastboot devices" commands.

I wish we could do this a bit more generically but...

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150304/03b57710/attachment.sig>
#21 lore raw

PATCH v3 3/4 ARM: DRA7: Set serial number environment variable

In reply to Dileep Katta
Quoted 18 lines · Dileep Katta

Adds the registers to get the serial number of dra7xx boards. Serial# environment variable will be set if not done already. This will be useful to show correct information in "fastboot devices" commands.

---
 arch/arm/cpu/armv7/omap5/prcm-regs.c |  2 ++
 arch/arm/include/asm/omap_common.h   |  2 ++
 board/ti/dra7xx/evm.c                | 11 +++++++++++
 3 files changed, 15 insertions(+)
arch/arm/cpu/armv7/omap5/prcm-regs.c +0 -0
index 0745d42..020a964 100644

arch/arm/cpu/armv7/omap5/prcm-regs.c struct omap_sys_ctrl_regs const dra7xx_ctrl = { · line 444

Quoted 5 lines
arch/arm/cpu/armv7/omap5/prcm-regs.c +2 -0
@@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
 	.control_emif1_sdram_config_ext		= 0x4AE0C144,
 	.control_emif2_sdram_config_ext		= 0x4AE0C148,
 	.control_wkup_ldovbb_mpu_voltage_ctrl	= 0x4AE0C158,
+	.control_std_fuse_die_id_3		= 0x4AE0C210,
+	.control_std_fuse_prod_id_0		= 0x4AE0C214,

Are these serial numbers of dra7 "boards"? they dont match up with commit message.

http://www.ti.com/lit/ug/spruhz6/spruhz6.pdf
See section "AM572x Device Identification" on page 357 you would rather want to use CTRL_WKUP_STD_FUSE_DIE_ID_0,1,2,3

Is'nt better to unify with existing requirements such as arch/arm/cpu/armv7/omap3/sys_info.c dieid_num_r() such that every omap3,4,5,dra7 SoCs can use the same function in different ways (example: usb_fake_mac_from_die_id in omap5_uevm and panda) ?

here we do fastboot_serial_from_die_id? Standardizing such information allows us to just hook up the missing information for various SoCs and reuse the common code.

Quoted 43 lines
arch/arm/cpu/armv7/omap5/prcm-regs.c +0 -0
 	.control_padconf_mode			= 0x4AE0C5A0,
 	.control_xtal_oscillator		= 0x4AE0C5A4,
 	.control_i2c_2				= 0x4AE0C5A8,
arch/arm/include/asm/omap_common.h +2 -0
index 323952f..b329803 100644
@@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs {
 	u32 control_core_control_io1;
 	u32 control_core_control_io2;
 	u32 control_id_code;
+	u32 control_std_fuse_die_id_3;
+	u32 control_std_fuse_prod_id_0;
 	u32 control_std_fuse_opp_bgap;
 	u32 control_ldosram_iva_voltage_ctrl;
 	u32 control_ldosram_mpu_voltage_ctrl;
board/ti/dra7xx/evm.c +11 -0
index 6522241..e20d950 100644
@@ -88,10 +88,21 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	char serialno[72];
+	uint32_t serialno_lo, serialno_hi;
+
 	if (omap_revision() == DRA722_ES1_0)
 		setenv("board_name", "dra72x");
 	else
 		setenv("board_name", "dra7xx");
+
+	if (!getenv("serial#")) {
+		printf("serial# not set, setting...\n");
+		serialno_lo = readl((*ctrl)->control_std_fuse_die_id_3);
+		serialno_hi = readl((*ctrl)->control_std_fuse_prod_id_0);
+		sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
+		setenv("serial#", serialno);
+	}
 #endif
 	return 0;
 }
#22 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

In reply to Dileep Katta

Corrected Tom Rini's mail id.

Regards,
Dileep

Quoted 403 lines · Dileep Katta
---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313
+++++++++++++++++++++++++++++++++++
 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h
arch/arm/cpu/armv7/omap5/Kconfig +5 -0
index aca862d..d8e9b2d 100644
@@ -12,6 +12,11 @@ config TARGET_OMAP5_UEVM
 config TARGET_DRA7XX_EVM
        bool "TI DRA7XX"
 
+config TARGET_DRA7XX_EVM_ANDROID
+       bool "TI DRA7XX ANDROID"
+       ---help---
+       TI DRA7XX build for Android. Enables Fastboot.
+
 config TARGET_BEAGLE_X15
        bool "BeagleBoard X15"
 
board/ti/dra7xx/Kconfig +13 -0
index 3bbd866..6837998 100644
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
        default "dra7xx_evm"
 
 endif
+
+if TARGET_DRA7XX_EVM_ANDROID
+
+config SYS_BOARD
+       default "dra7xx"
+
+config SYS_VENDOR
+       default "ti"
+
+config SYS_CONFIG_NAME
+       default "dra7xx_evm_android"
+
+endif
board/ti/dra7xx/MAINTAINERS +2 -0
index 5ec6769..efd4f81 100644
@@ -6,3 +6,5 @@ F:      include/configs/dra7xx_evm.h
 F:     configs/dra7xx_evm_defconfig
 F:     configs/dra7xx_evm_qspiboot_defconfig
 F:     configs/dra7xx_evm_uart3_defconfig
+F:     include/configs/dra7xx_evm_android.h
+F:     configs/dra7xx_evm_android_defconfig
configs/dra7xx_evm_android_defconfig new file +5 -0
new file mode 100644
index 0000000..64ae4b3
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
++S:CONFIG_ARM=y
++S:CONFIG_OMAP54XX=y
++S:CONFIG_TARGET_DRA7XX_EVM_ANDROID=y
include/configs/dra7xx_evm_android.h new file +24 -0
new file mode 100644
index 0000000..68e7eec
@@ -0,0 +1,313 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments Incorporated.
+ * Lokesh Vutla          <[email protected]>
+ *
+ * Configuration settings for the TI DRA7XX board.
+ * See ti_omap5_common.h for omap5 common settings.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_DRA7XX_EVM_ANDROID_H
+#define __CONFIG_DRA7XX_EVM_ANDROID_H
+
+#define CONFIG_DRA7XX
+#define CONFIG_BOARD_EARLY_INIT_F
+
+#ifndef CONFIG_QSPI_BOOT
+/* MMC ENV related defines */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV         1       /* SLOT2: eMMC(1) */
+#define CONFIG_ENV_SIZE                        (128 << 10)
+#define CONFIG_ENV_OFFSET              0xE0000
+#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET +

CONFIG_ENV_SIZE)

include/configs/dra7xx_evm_android.h new file +10 -0
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#endif
+#define CONFIG_CMD_SAVEENV
+
+#if (CONFIG_CONS_INDEX == 1)
+#define CONSOLEDEV                     "ttyO0"
+#elif (CONFIG_CONS_INDEX == 3)
+#define CONSOLEDEV                     "ttyO2"
+#endif
+#define CONFIG_SYS_NS16550_COM1                UART1_BASE      /* Base

EVM has UART0 */

include/configs/dra7xx_evm_android.h new file +77 -0
+#define CONFIG_SYS_NS16550_COM2                UART2_BASE      /* UART2 */
+#define CONFIG_SYS_NS16550_COM3                UART3_BASE      /* UART3 */
+#define CONFIG_BAUDRATE                        115200
+
+#define CONFIG_SYS_OMAP_ABE_SYSCK
+
+/* Define the default GPT table for eMMC */
+#define PARTS_DEFAULT \
+       "uuid_disk=${uuid_gpt_disk};" \
+       "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
+
+#ifdef CONFIG_NAND
+/* Define NAND information. */
+#define NANDARGS \
+       "mtdids=" MTDIDS_DEFAULT "\0" \
+       "mtdparts=" MTDPARTS_DEFAULT "\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "${optargs} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+       "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048\0" \
+       "nandrootfstype=ubifs rootwait=1\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${fdtaddr} NAND.u-boot-spl-os; " \
+               "nand read ${loadaddr} NAND.kernel; " \
+               "bootz ${loadaddr} - ${fdtaddr}\0"
+#define NANDBOOT                       "run nandboot; "
+#endif
+
+#define DFU_ALT_INFO_MMC \
+       "dfu_alt_info_mmc=" \
+       "boot part 0 1;" \
+       "rootfs part 0 2;" \
+       "MLO fat 0 1;" \
+       "spl-os-args fat 0 1;" \
+       "spl-os-image fat 0 1;" \
+       "u-boot.img fat 0 1;" \
+       "uEnv.txt fat 0 1\0"
+
+#define DFU_ALT_INFO_EMMC \
+       "dfu_alt_info_emmc=" \
+       "MLO raw 0x100 0x100 mmcpart 0;" \
+       "u-boot.img raw 0x300 0x1000 mmcpart 0\0"
+
+#define DFU_ALT_INFO_RAM \
+       "dfu_alt_info_ram=" \
+       "kernel ram 0x80200000 0x4000000;" \
+       "fdt ram 0x80f80000 0x80000;" \
+       "ramdisk ram 0x81000000 0x4000000\0"
+
+#define DFUARGS \
+       "dfu_bufsiz=0x10000\0" \
+       DFU_ALT_INFO_MMC \
+       DFU_ALT_INFO_EMMC \
+       DFU_ALT_INFO_RAM
+
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+
+#include <configs/ti_omap5_common.h>
+
+/* Enhance our eMMC support / experience. */
+#define CONFIG_CMD_GPT
+#define CONFIG_EFI_PARTITION
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_PART
+
+/* CPSW Ethernet */
+#define CONFIG_CMD_NET                 /* 'bootp' and 'tftp' */
+#define CONFIG_CMD_DHCP
+#define CONFIG_BOOTP_DNS               /* Configurable parts of CMD_DHCP

*/

include/configs/dra7xx_evm_android.h new file +10 -0
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_NET_RETRY_COUNT         10
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_DRIVER_TI_CPSW          /* Driver for IP block */
+#define CONFIG_MII                     /* Required in net/eth.c */
+#define CONFIG_PHY_GIGE                        /* per-board part of CPSW

*/

include/configs/dra7xx_evm_android.h new file +152 -0
+#define CONFIG_PHYLIB
+
+/* SPI */
+#undef CONFIG_OMAP3_SPI
+#define CONFIG_TI_QSPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH_BAR
+#define CONFIG_TI_SPI_MMAP
+#define CONFIG_SF_DEFAULT_SPEED                48000000
+#define CONFIG_DEFAULT_SPI_MODE                SPI_MODE_3
+
+/*
+ * Default to using SPI for environment, etc.
+ * 0x000000 - 0x010000 : QSPI.SPL (64KiB)
+ * 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB)
+ * 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB)
+ * 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB)
+ * 0x040000 - 0x140000 : QSPI.u-boot (1MiB)
+ * 0x140000 - 0x1C0000 : QSPI.u-boot-spl-os (512KiB)
+ * 0x1C0000 - 0x1D0000 : QSPI.u-boot-env (64KiB)
+ * 0x1D0000 - 0x1E0000 : QSPI.u-boot-env.backup1 (64KiB)
+ * 0x1E0000 - 0x9E0000 : QSPI.kernel (8MiB)
+ * 0x9E0000 - 0x2000000 : USERLAND
+ */
+#define CONFIG_SYS_SPI_KERNEL_OFFS     0x1E0000
+#define CONFIG_SYS_SPI_ARGS_OFFS       0x140000
+#define CONFIG_SYS_SPI_ARGS_SIZE       0x80000
+#if defined(CONFIG_QSPI_BOOT)
+/* In SPL, use the environment and discard MMC support for space. */
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_SPL_MMC_SUPPORT
+#undef CONFIG_SPL_MAX_SIZE
+#define CONFIG_SPL_MAX_SIZE             (64 << 10) /* 64 KiB */
+#endif
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SIZE                        (64 << 10)
+#define CONFIG_ENV_SECT_SIZE           (64 << 10) /* 64 KB sectors */
+#define CONFIG_ENV_OFFSET              0x1C0000
+#define CONFIG_ENV_OFFSET_REDUND       0x1D0000
+#endif
+
+/* SPI SPL */
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_DMA_SUPPORT
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_TI_EDMA
+#endif
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_BUS             0
+#define CONFIG_SPL_SPI_CS              0
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+
+#define CONFIG_SUPPORT_EMMC_BOOT
+
+/* USB xHCI HOST */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_XHCI
+#define CONFIG_USB_XHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
+
+#define CONFIG_OMAP_USB_PHY
+#define CONFIG_OMAP_USB2PHY2_HOST
+
+/* USB GADGET */
+#define CONFIG_USB_DWC3_PHY_OMAP
+#define CONFIG_USB_DWC3_OMAP
+#define CONFIG_USB_DWC3
+#define CONFIG_USB_DWC3_GADGET
+
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#define CONFIG_USB_GADGET_DUALSPEED
+
+/* USB Device Firmware Update support */
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_RAM
+#define CONFIG_CMD_DFU
+
+#define CONFIG_DFU_MMC
+#define CONFIG_DFU_RAM
+
+/* SATA */
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_CMD_SCSI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
+#define CONFIG_SYS_SCSI_MAX_LUN                1
+#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+                                               CONFIG_SYS_SCSI_MAX_LUN)
+
+/* NAND support */
+#ifdef CONFIG_NAND
+/* NAND: device related configs */
+#define CONFIG_SYS_NAND_PAGE_SIZE      2048
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_BLOCK_SIZE     (128*1024)
+#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
+#define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
+                                        CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+/* NAND: driver related configs */
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_NAND_OMAP_ELM
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_NAND_OMAP_ECCSCHEME     OMAP_ECC_BCH8_CODE_HW
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS         { 2, 3, 4, 5, 6, 7, 8, 9, \
+                                        10, 11, 12, 13, 14, 15, 16, 17, \
+                                        18, 19, 20, 21, 22, 23, 24, 25, \
+                                        26, 27, 28, 29, 30, 31, 32, 33, \
+                                        34, 35, 36, 37, 38, 39, 40, 41, \
+                                        42, 43, 44, 45, 46, 47, 48, 49, \
+                                        50, 51, 52, 53, 54, 55, 56, 57, }
+#define CONFIG_SYS_NAND_ECCSIZE                512
+#define CONFIG_SYS_NAND_ECCBYTES       14
+#define MTDIDS_DEFAULT                 "nand0=nand.0"
+#define MTDPARTS_DEFAULT               "mtdparts=nand.0:" \
+                                       "128k(NAND.SPL)," \
+                                       "128k(NAND.SPL.backup1)," \
+                                       "128k(NAND.SPL.backup2)," \
+                                       "128k(NAND.SPL.backup3)," \
+                                       "256k(NAND.u-boot-spl-os)," \
+                                       "1m(NAND.u-boot)," \
+                                       "128k(NAND.u-boot-env)," \
+                                       "128k(NAND.u-boot-env.backup1)," \
+                                       "8m(NAND.kernel)," \
+                                       "-(NAND.file-system)"
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x000c0000
+/* NAND: SPL related configs */
+#ifdef CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_AM33XX_BCH
+#endif
+/* NAND: SPL falcon mode configs */
+#ifdef CONFIG_SPL_OS_BOOT
+#define CONFIG_CMD_SPL_NAND_OFS                0x00080000 /* os-boot

params*/
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel
offset */

include/configs/dra7xx_evm_android.h new file +39 -1
+#define CONFIG_CMD_SPL_WRITE_SIZE      0x2000
+#endif
+#endif /* !CONFIG_NAND */
+
+/* Parallel NOR Support */
+#if defined(CONFIG_NOR)
+/* NOR: device related configs */
+#define CONFIG_SYS_MAX_FLASH_SECT      512
+#define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
+#define CONFIG_SYS_FLASH_SIZE          (64 * 1024 * 1024) /* 64 MB */
+/* #define CONFIG_INIT_IGNORE_ERROR */
+#undef CONFIG_SYS_NO_FLASH
+#define CONFIG_CMD_FLASH
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_SYS_MAX_FLASH_BANKS     1
+#define CONFIG_SYS_FLASH_BASE          (0x08000000)
+#define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_FLASH_BASE
+/* Reduce SPL size by removing unlikey targets */
+#ifdef CONFIG_NOR_BOOT
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SECT_SIZE           (128 * 1024)    /* 128 KiB */
+#define MTDIDS_DEFAULT                 "nor0=physmap-flash.0"
+#define MTDPARTS_DEFAULT               "mtdparts=physmap-flash.0:" \
+                                       "1m(NOR.u-boot)," \
+                                       "128k(NOR.u-boot-env)," \
+                                       "128k(NOR.u-boot-env.backup1)," \
+                                       "256k(NOR.u-boot-spl-os)," \
+                                       "8m(NOR.kernel)," \
+                                       "-(NOR.rootfs)"
+#define CONFIG_ENV_OFFSET              0x00100000
+#define CONFIG_ENV_OFFSET_REDUND       0x00120000
+#endif
+#endif  /* NOR support */
+
+#endif /* __CONFIG_DRA7XX_EVM_ANDROID_H */
--

1.8.3.2

#23 lore raw

PATCH 4/4 ARM: DRA7: fastboot: Implement reboot-bootloader command - Implemented fb_set_reboot_flag() for DRA7 - Defined a weak function, fb_check_reboot_flag() - Implemented for DRA7

In reply to Dileep Katta
---
 board/ti/dra7xx/Makefile             |  1 +
 board/ti/dra7xx/fastboot.c           | 45 ++++++++++++++++++++++++++++++++++++
 common/cmd_bootm.c                   |  5 ++++
 drivers/usb/gadget/f_fastboot.c      |  5 ++++
 include/configs/dra7xx_evm_android.h | 14 +++++++++++
 5 files changed, 70 insertions(+)
 create mode 100644 board/ti/dra7xx/fastboot.c
board/ti/dra7xx/Makefile +1 -0
index 434e8d1..ae730ae 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y	:= evm.o
+obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
board/ti/dra7xx/fastboot.c new file +45 -0

45 lines not on this page · raw message

common/cmd_bootm.c +5 -0
index 48199bf..00791be 100644
@@ -729,6 +729,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int ret;
 
+#if defined(CONFIG_CMD_FASTBOOT)
+	if (!fb_check_reboot_flag())
+		do_fastboot(cmdtp, flag, argc, argv);
+#endif
+
 	/* Consume 'booti' */
 	argc--; argv++;
 
drivers/usb/gadget/f_fastboot.c +5 -0
index 206b6d1..a450357 100644
@@ -332,6 +332,11 @@ int __weak fb_set_reboot_flag(void)
 	return -ENOSYS;
 }
 
+int __weak fb_check_reboot_flag(void)
+{
+	return -ENOSYS;
+}
+
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
 	char *cmd = req->buf;
include/configs/dra7xx_evm_android.h +14 -0
index 68e7eec..2038e00 100644
@@ -310,4 +310,18 @@
 #endif
 #endif  /* NOR support */
 
+#define DRA7XX_PUBLIC_SAR_RAM_1_FREE           (0x4AE26000 + 0xFE0)
+#define DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT      (1<<0)
+#define DRA7XX_PRM_RSTST_RESET_WARM_BIT        (1<<1)
+#define DRA7XX_PRM_RSTST                       0x4AE07D04
+#define DRA7XX_PRM_RSTCTRL                     0x4AE07D00
+#define DRA7XX_PRM_RSTST_CLR                   0xfff
+#define DRA7XX_REBOOT_REASON_SIZE              0xf
+
+#define CONFIG_BOARD_MACH_TYPE                  4070
+#define MEMORY_BASE                             0x80000000
+#define CONFIG_ADDR_ATAGS                       (MEMORY_BASE + 0x100)
+#define CONFIG_ADDR_DOWNLOAD                    (MEMORY_BASE + 0x02000000)
+#define DEVICE_TREE                             0x82f80000
+
 #endif /* __CONFIG_DRA7XX_EVM_ANDROID_H */
Signature · 1 line
1.8.3.2
#24 lore raw

PATCH 4/4 ARM: DRA7: fastboot: Implement reboot-bootloader command - Implemented fb_set_reboot_flag() for DRA7 - Defined a weak function, fb_check_reboot_flag() - Implemented for DRA7

Quoted 44 lines · Dileep Katta
---
 board/ti/dra7xx/Makefile             |  1 +
 board/ti/dra7xx/fastboot.c           | 45 ++++++++++++++++++++++++++++++++++++
 common/cmd_bootm.c                   |  5 ++++
 drivers/usb/gadget/f_fastboot.c      |  5 ++++
 include/configs/dra7xx_evm_android.h | 14 +++++++++++
 5 files changed, 70 insertions(+)
 create mode 100644 board/ti/dra7xx/fastboot.c
board/ti/dra7xx/Makefile +1 -0
index 434e8d1..ae730ae 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y  := evm.o
+obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
board/ti/dra7xx/fastboot.c new file +18 -0
new file mode 100644
index 0000000..e05010d
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * Lokesh Vutla <[email protected]>
+ *
+ * Based on previous work by:
+ * Aneesh V       <[email protected]>
+ * Steve Sakoman  <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <asm-generic/gpio.h>
+#include <config.h>
+
+

board/ti/dra7xx/fastboot.c line 28

Quoted 10 lines
board/ti/dra7xx/fastboot.c new file +10 -0
+int fb_set_reboot_flag(void)
+{
+       /* clear all reset events */
+       __raw_writel(DRA7XX_PRM_RSTST_CLR, PRM_RSTST);
+       strncpy((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "bootloader",
+               DRA7XX_REBOOT_REASON_SIZE - 1);
+       *(((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE) +
+                               DRA7XX_REBOOT_REASON_SIZE - 1) = '\0';
+       /* trigger warm reset */
+       __raw_writel(DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT, DRA7XX_PRM_RSTCTRL);

Does this reset immediately? If so, then you will fail to send a response to the client.

Quoted 22 lines
board/ti/dra7xx/fastboot.c new file +17 -0
+
+       return 0;
+}
+
+int fb_check_reboot_flag(void)
+{
+       /* Check if we are coming from a warm reset */
+       if (__raw_readl(DRA7XX_PRM_RSTST) & DRA7XX_PRM_RSTST_RESET_WARM_BIT)
+               if (!strncmp((const char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE,
+                               "bootloader", DRA7XX_REBOOT_REASON_SIZE)) {
+                       strncpy((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "",
+                               DRA7XX_REBOOT_REASON_SIZE);
+                       return 0;
+               }
+
+       return 1;
+}
common/cmd_bootm.c +0 -0
index 48199bf..00791be 100644

common/cmd_bootm.c int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 735

Quoted 7 lines
common/cmd_bootm.c +4 -0
@@ -729,6 +729,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int ret;
 
+#if defined(CONFIG_CMD_FASTBOOT)
+       if (!fb_check_reboot_flag())
+               do_fastboot(cmdtp, flag, argc, argv);
+#endif

Part of the booti command? First, booti is for arm64 Image files. How does this work for you?

More importantly, this should not be tied into any bootX command. It should probably be done in a boot script. If the flag is set, the board code can set some environment variable. Then the boot script can run the fastboot command if the env var is set.

Quoted 27 lines
common/cmd_bootm.c +1 -0
+
        /* Consume 'booti' */
        argc--; argv++;
 
drivers/usb/gadget/f_fastboot.c +5 -0
index 206b6d1..a450357 100644
@@ -332,6 +332,11 @@ int __weak fb_set_reboot_flag(void)
        return -ENOSYS;
 }
 
+int __weak fb_check_reboot_flag(void)
+{
+       return -ENOSYS;
+}
+
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
        char *cmd = req->buf;
include/configs/dra7xx_evm_android.h +0 -0
index 68e7eec..2038e00 100644
@@ -310,4 +310,18 @@
 #endif
 #endif  /* NOR support */

include/configs/dra7xx_evm_android.h line 321

Quoted 10 lines
include/configs/dra7xx_evm_android.h +9 -0
 
+#define DRA7XX_PUBLIC_SAR_RAM_1_FREE           (0x4AE26000 + 0xFE0)
+#define DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT      (1<<0)
+#define DRA7XX_PRM_RSTST_RESET_WARM_BIT        (1<<1)
+#define DRA7XX_PRM_RSTST                       0x4AE07D04
+#define DRA7XX_PRM_RSTCTRL                     0x4AE07D00
+#define DRA7XX_PRM_RSTST_CLR                   0xfff
+#define DRA7XX_REBOOT_REASON_SIZE              0xf
+
+#define CONFIG_BOARD_MACH_TYPE                  4070

You shouldn't need this anymore, right?

include/configs/dra7xx_evm_android.h line 323

Quoted 2 lines
include/configs/dra7xx_evm_android.h +2 -0
+#define MEMORY_BASE                             0x80000000
+#define CONFIG_ADDR_ATAGS                       (MEMORY_BASE + 0x100)

Or this?

include/configs/dra7xx_evm_android.h line 325

Quoted 2 lines
include/configs/dra7xx_evm_android.h +2 -0
+#define CONFIG_ADDR_DOWNLOAD                    (MEMORY_BASE + 0x02000000)
+#define DEVICE_TREE                             0x82f80000

Use fdt_addr_r env var instead?

Rob

#25 lore raw

PATCH 4/4 ARM: DRA7: fastboot: Implement reboot-bootloader command - Implemented fb_set_reboot_flag() for DRA7 - Defined a weak function, fb_check_reboot_flag() - Implemented for DRA7

Quoted 3 lines · Rob Herring
Quoted 2 lines · Dileep Katta

You need a full commit message as I don't really understand what this is supposed to be doing or why it's needed.

Quoted 122 lines
Quoted 42 lines
---
 board/ti/dra7xx/Makefile             |  1 +
 board/ti/dra7xx/fastboot.c           | 45 ++++++++++++++++++++++++++++++++++++
 common/cmd_bootm.c                   |  5 ++++
 drivers/usb/gadget/f_fastboot.c      |  5 ++++
 include/configs/dra7xx_evm_android.h | 14 +++++++++++
 5 files changed, 70 insertions(+)
 create mode 100644 board/ti/dra7xx/fastboot.c
board/ti/dra7xx/Makefile +1 -0
index 434e8d1..ae730ae 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y  := evm.o
+obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
board/ti/dra7xx/fastboot.c new file +18 -0
new file mode 100644
index 0000000..e05010d
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * Lokesh Vutla <[email protected]>
+ *
+ * Based on previous work by:
+ * Aneesh V       <[email protected]>
+ * Steve Sakoman  <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <asm-generic/gpio.h>
+#include <config.h>
+
+

board/ti/dra7xx/fastboot.c line 28

Quoted 10 lines
board/ti/dra7xx/fastboot.c new file +10 -0
+int fb_set_reboot_flag(void)
+{
+       /* clear all reset events */
+       __raw_writel(DRA7XX_PRM_RSTST_CLR, PRM_RSTST);
+       strncpy((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "bootloader",
+               DRA7XX_REBOOT_REASON_SIZE - 1);
+       *(((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE) +
+                               DRA7XX_REBOOT_REASON_SIZE - 1) = '\0';
+       /* trigger warm reset */
+       __raw_writel(DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT, DRA7XX_PRM_RSTCTRL);

Does this reset immediately? If so, then you will fail to send a response to the client.

Quoted 22 lines
board/ti/dra7xx/fastboot.c new file +17 -0
+
+       return 0;
+}
+
+int fb_check_reboot_flag(void)
+{
+       /* Check if we are coming from a warm reset */
+       if (__raw_readl(DRA7XX_PRM_RSTST) & DRA7XX_PRM_RSTST_RESET_WARM_BIT)
+               if (!strncmp((const char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE,
+                               "bootloader", DRA7XX_REBOOT_REASON_SIZE)) {
+                       strncpy((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "",
+                               DRA7XX_REBOOT_REASON_SIZE);
+                       return 0;
+               }
+
+       return 1;
+}
common/cmd_bootm.c +0 -0
index 48199bf..00791be 100644

common/cmd_bootm.c int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 735

Quoted 7 lines
common/cmd_bootm.c +4 -0
@@ -729,6 +729,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int ret;
 
+#if defined(CONFIG_CMD_FASTBOOT)
+       if (!fb_check_reboot_flag())
+               do_fastboot(cmdtp, flag, argc, argv);
+#endif

Part of the booti command? First, booti is for arm64 Image files. How does this work for you?

More importantly, this should not be tied into any bootX command. It should probably be done in a boot script. If the flag is set, the board code can set some environment variable. Then the boot script can run the fastboot command if the env var is set.

Quoted 28 lines
common/cmd_bootm.c +1 -0
+
        /* Consume 'booti' */
        argc--; argv++;
 
drivers/usb/gadget/f_fastboot.c +5 -0
index 206b6d1..a450357 100644
@@ -332,6 +332,11 @@ int __weak fb_set_reboot_flag(void)
        return -ENOSYS;
 }
 
+int __weak fb_check_reboot_flag(void)
+{
+       return -ENOSYS;
+}
+
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
        char *cmd = req->buf;
include/configs/dra7xx_evm_android.h +0 -0
index 68e7eec..2038e00 100644
@@ -310,4 +310,18 @@
 #endif
 #endif  /* NOR support */
 
Quoted 7 lines

include/configs/dra7xx_evm_android.h line 319

Quoted 7 lines
include/configs/dra7xx_evm_android.h +7 -0
+#define DRA7XX_PUBLIC_SAR_RAM_1_FREE           (0x4AE26000 + 0xFE0)
+#define DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT      (1<<0)
+#define DRA7XX_PRM_RSTST_RESET_WARM_BIT        (1<<1)
+#define DRA7XX_PRM_RSTST                       0x4AE07D04
+#define DRA7XX_PRM_RSTCTRL                     0x4AE07D00
+#define DRA7XX_PRM_RSTST_CLR                   0xfff
+#define DRA7XX_REBOOT_REASON_SIZE              0xf

These defines, if really needed, need to end up somewhere under arch/arm/include/asm/arch-omap5/ and the code using them somewhere under arch/arm/cpu/armv7/omap-common/

Quoted 9 lines

include/configs/dra7xx_evm_android.h line 321

Quoted 1 line
include/configs/dra7xx_evm_android.h +1 -0
+#define CONFIG_BOARD_MACH_TYPE                  4070

You shouldn't need this anymore, right?

include/configs/dra7xx_evm_android.h line 323

Quoted 2 lines
include/configs/dra7xx_evm_android.h +2 -0
+#define MEMORY_BASE                             0x80000000
+#define CONFIG_ADDR_ATAGS                       (MEMORY_BASE + 0x100)

Or this?

Quoted 4 lines

include/configs/dra7xx_evm_android.h line 325

Quoted 2 lines
include/configs/dra7xx_evm_android.h +2 -0
+#define CONFIG_ADDR_DOWNLOAD                    (MEMORY_BASE + 0x02000000)
+#define DEVICE_TREE                             0x82f80000

Use fdt_addr_r env var instead?

Yeah, this doesn't look right, nor genericially done for something I imagine "everyone" doing fastboot would want to get at.

Quoted 6 lines

Rob
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150304/d432dbbe/attachment.sig>
#26 lore raw

PATCH 4/4 ARM: DRA7: fastboot: Implement reboot-bootloader command - Implemented fb_set_reboot_flag() for DRA7 - Defined a weak function, fb_check_reboot_flag() - Implemented for DRA7

In reply to Dileep Katta

Hi Dileep,

Quoted 129 lines
---
 board/ti/dra7xx/Makefile             |  1 +
 board/ti/dra7xx/fastboot.c           | 45
++++++++++++++++++++++++++++++++++++
common/cmd_bootm.c                   |  5 ++++
drivers/usb/gadget/f_fastboot.c      |  5 ++++
include/configs/dra7xx_evm_android.h | 14 +++++++++++ 5 files

changed, 70 insertions(+) create mode 100644
board/ti/dra7xx/fastboot.c

board/ti/dra7xx/Makefile +1 -0
index 434e8d1..ae730ae 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y	:= evm.o
+obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
board/ti/dra7xx/fastboot.c new file +26 -0
new file mode 100644
index 0000000..e05010d
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * Lokesh Vutla <[email protected]>
+ *
+ * Based on previous work by:
+ * Aneesh V       <[email protected]>
+ * Steve Sakoman  <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <asm-generic/gpio.h>
+#include <config.h>
+
+
+int fb_set_reboot_flag(void)
+{
+	/* clear all reset events */
+	__raw_writel(DRA7XX_PRM_RSTST_CLR, PRM_RSTST);
+	strncpy((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "bootloader",
+		DRA7XX_REBOOT_REASON_SIZE - 1);
+	*(((char *)DRA7XX_PUBLIC_SAR_RAM_1_FREE) +
+				DRA7XX_REBOOT_REASON_SIZE - 1) =

'\0';

board/ti/dra7xx/fastboot.c new file +2 -0
+	/* trigger warm reset */
+	__raw_writel(DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT,

DRA7XX_PRM_RSTCTRL); +

board/ti/dra7xx/fastboot.c new file +7 -0
+	return 0;
+}
+
+int fb_check_reboot_flag(void)
+{
+	/* Check if we are coming from a warm reset */
+	if (__raw_readl(DRA7XX_PRM_RSTST) &

DRA7XX_PRM_RSTST_RESET_WARM_BIT)

board/ti/dra7xx/fastboot.c new file +1 -0
+		if (!strncmp((const char

*)DRA7XX_PUBLIC_SAR_RAM_1_FREE,

board/ti/dra7xx/fastboot.c new file +1 -0
+				"bootloader",

DRA7XX_REBOOT_REASON_SIZE)) {

board/ti/dra7xx/fastboot.c new file +1 -0
+			strncpy((char

*)DRA7XX_PUBLIC_SAR_RAM_1_FREE, "",

board/ti/dra7xx/fastboot.c new file +6 -0
+				DRA7XX_REBOOT_REASON_SIZE);
+			return 0;
+		}
+
+	return 1;
+}
common/cmd_bootm.c +5 -0
index 48199bf..00791be 100644
@@ -729,6 +729,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int
 argc, char * const argv[]) {
 	int ret;
 
+#if defined(CONFIG_CMD_FASTBOOT)
+	if (!fb_check_reboot_flag())
+		do_fastboot(cmdtp, flag, argc, argv);
+#endif
+
 	/* Consume 'booti' */
 	argc--; argv++;
 
(quoted diff) +0 -0

b/drivers/usb/gadget/f_fastboot.c index 206b6d1..a450357 100644

drivers/usb/gadget/f_fastboot.c +5 -0
@@ -332,6 +332,11 @@ int __weak fb_set_reboot_flag(void)
 	return -ENOSYS;
 }
 
+int __weak fb_check_reboot_flag(void)
+{
+	return -ENOSYS;
+}
+
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
 	char *cmd = req->buf;
(quoted diff) +0 -0

b/include/configs/dra7xx_evm_android.h index 68e7eec..2038e00 100644

include/configs/dra7xx_evm_android.h +12 -0
@@ -310,4 +310,18 @@
 #endif
 #endif  /* NOR support */
 
+#define DRA7XX_PUBLIC_SAR_RAM_1_FREE           (0x4AE26000 + 0xFE0)
+#define DRA7XX_PRM_RSTCTRL_RESET_WARM_BIT      (1<<0)
+#define DRA7XX_PRM_RSTST_RESET_WARM_BIT        (1<<1)
+#define DRA7XX_PRM_RSTST                       0x4AE07D04
+#define DRA7XX_PRM_RSTCTRL                     0x4AE07D00
+#define DRA7XX_PRM_RSTST_CLR                   0xfff
+#define DRA7XX_REBOOT_REASON_SIZE              0xf
+
+#define CONFIG_BOARD_MACH_TYPE                  4070
+#define MEMORY_BASE                             0x80000000
+#define CONFIG_ADDR_ATAGS                       (MEMORY_BASE + 0x100)
+#define CONFIG_ADDR_DOWNLOAD                    (MEMORY_BASE +
Quoted 3 lines

0x02000000) +#define DEVICE_TREE
0x82f80000 +
#endif /* __CONFIG_DRA7XX_EVM_ANDROID_H */

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#27 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

In reply to Dileep Katta

Hi Dileep,

Quoted 33 lines
---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313
+++++++++++++++++++++++++++++++++++ 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap5/Kconfig index aca862d..d8e9b2d 100644

arch/arm/cpu/armv7/omap5/Kconfig +5 -0
@@ -12,6 +12,11 @@ config TARGET_OMAP5_UEVM
 config TARGET_DRA7XX_EVM
 	bool "TI DRA7XX"
 
+config TARGET_DRA7XX_EVM_ANDROID
+	bool "TI DRA7XX ANDROID"
+	---help---
+	TI DRA7XX build for Android. Enables Fastboot.
+
 config TARGET_BEAGLE_X15
 	bool "BeagleBoard X15"
 
board/ti/dra7xx/Kconfig +0 -0
index 3bbd866..6837998 100644

board/ti/dra7xx/Kconfig config SYS_CONFIG_NAME · line 15

Quoted 6 lines
board/ti/dra7xx/Kconfig +3 -0
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
 	default "dra7xx_evm"
 
 endif
+
+if TARGET_DRA7XX_EVM_ANDROID
+

No needed blank line

board/ti/dra7xx/Kconfig config SYS_CONFIG_NAME · line 24

Quoted 9 lines
board/ti/dra7xx/Kconfig +9 -0
+config SYS_BOARD
+	default "dra7xx"
+
+config SYS_VENDOR
+	default "ti"
+
+config SYS_CONFIG_NAME
+	default "dra7xx_evm_android"
+

ditto

Quoted 49 lines
board/ti/dra7xx/Kconfig +1 -0
+endif
board/ti/dra7xx/MAINTAINERS +2 -0
index 5ec6769..efd4f81 100644
@@ -6,3 +6,5 @@ F:	include/configs/dra7xx_evm.h
 F:	configs/dra7xx_evm_defconfig
 F:	configs/dra7xx_evm_qspiboot_defconfig
 F:	configs/dra7xx_evm_uart3_defconfig
+F:	include/configs/dra7xx_evm_android.h
+F:	configs/dra7xx_evm_android_defconfig
(quoted diff) +0 -0

b/configs/dra7xx_evm_android_defconfig new file mode 100644 index 0000000..64ae4b3

configs/dra7xx_evm_android_defconfig new file +5 -0
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
++S:CONFIG_ARM=y
++S:CONFIG_OMAP54XX=y
++S:CONFIG_TARGET_DRA7XX_EVM_ANDROID=y
(quoted diff) +0 -0

b/include/configs/dra7xx_evm_android.h new file mode 100644 index 0000000..68e7eec

include/configs/dra7xx_evm_android.h new file +21 -0
@@ -0,0 +1,313 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments Incorporated.
+ * Lokesh Vutla	  <[email protected]>
+ *
+ * Configuration settings for the TI DRA7XX board.
+ * See ti_omap5_common.h for omap5 common settings.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_DRA7XX_EVM_ANDROID_H
+#define __CONFIG_DRA7XX_EVM_ANDROID_H
+
+#define CONFIG_DRA7XX
+#define CONFIG_BOARD_EARLY_INIT_F
+
+#ifndef CONFIG_QSPI_BOOT
+/* MMC ENV related defines */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2:
Quoted 1 line

eMMC(1) */ +#define CONFIG_ENV_SIZE (128 << 10)

Please use SZ_1K instead of << 10

Quoted 125 lines
include/configs/dra7xx_evm_android.h new file +2 -0
+#define CONFIG_ENV_OFFSET		0xE0000
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET +

CONFIG_ENV_SIZE) +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

include/configs/dra7xx_evm_android.h new file +9 -0
+#endif
+#define CONFIG_CMD_SAVEENV
+
+#if (CONFIG_CONS_INDEX == 1)
+#define CONSOLEDEV			"ttyO0"
+#elif (CONFIG_CONS_INDEX == 3)
+#define CONSOLEDEV			"ttyO2"
+#endif
+#define CONFIG_SYS_NS16550_COM1		UART1_BASE	/*

Base EVM has UART0 */ +#define CONFIG_SYS_NS16550_COM2
UART2_BASE /* UART2 */ +#define
CONFIG_SYS_NS16550_COM3 UART3_BASE /* UART3 */

include/configs/dra7xx_evm_android.h new file +72 -0
+#define CONFIG_BAUDRATE			115200 +
+#define CONFIG_SYS_OMAP_ABE_SYSCK
+
+/* Define the default GPT table for eMMC */
+#define PARTS_DEFAULT \
+	"uuid_disk=${uuid_gpt_disk};" \
+	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
+
+#ifdef CONFIG_NAND
+/* Define NAND information. */
+#define NANDARGS \
+	"mtdids=" MTDIDS_DEFAULT "\0" \
+	"mtdparts=" MTDPARTS_DEFAULT "\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"${optargs} " \
+		"root=${nandroot} " \
+		"rootfstype=${nandrootfstype}\0" \
+	"nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048\0" \
+	"nandrootfstype=ubifs rootwait=1\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${fdtaddr} NAND.u-boot-spl-os; " \
+		"nand read ${loadaddr} NAND.kernel; " \
+		"bootz ${loadaddr} - ${fdtaddr}\0"
+#define NANDBOOT			"run nandboot; "
+#endif
+
+#define DFU_ALT_INFO_MMC \
+	"dfu_alt_info_mmc=" \
+	"boot part 0 1;" \
+	"rootfs part 0 2;" \
+	"MLO fat 0 1;" \
+	"spl-os-args fat 0 1;" \
+	"spl-os-image fat 0 1;" \
+	"u-boot.img fat 0 1;" \
+	"uEnv.txt fat 0 1\0"
+
+#define DFU_ALT_INFO_EMMC \
+	"dfu_alt_info_emmc=" \
+	"MLO raw 0x100 0x100 mmcpart 0;" \
+	"u-boot.img raw 0x300 0x1000 mmcpart 0\0"
+
+#define DFU_ALT_INFO_RAM \
+	"dfu_alt_info_ram=" \
+	"kernel ram 0x80200000 0x4000000;" \
+	"fdt ram 0x80f80000 0x80000;" \
+	"ramdisk ram 0x81000000 0x4000000\0"
+
+#define DFUARGS \
+	"dfu_bufsiz=0x10000\0" \
+	DFU_ALT_INFO_MMC \
+	DFU_ALT_INFO_EMMC \
+	DFU_ALT_INFO_RAM
+
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+
+#include <configs/ti_omap5_common.h>
+
+/* Enhance our eMMC support / experience. */
+#define CONFIG_CMD_GPT
+#define CONFIG_EFI_PARTITION
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_PART
+
+/* CPSW Ethernet */
+#define CONFIG_CMD_NET			/* 'bootp' and 'tftp'

*/ +#define CONFIG_CMD_DHCP
+#define CONFIG_BOOTP_DNS /* Configurable parts of
CMD_DHCP */ +#define CONFIG_BOOTP_DNS2

include/configs/dra7xx_evm_android.h new file +7 -0
+#define CONFIG_BOOTP_SEND_HOSTNAME
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_NET_RETRY_COUNT		10
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
+#define CONFIG_DRIVER_TI_CPSW		/* Driver for IP block

*/ +#define CONFIG_MII /* Required in
net/eth.c */ +#define CONFIG_PHY_GIGE /*
per-board part of CPSW */ +#define CONFIG_PHYLIB

include/configs/dra7xx_evm_android.h new file +25 -0
+
+/* SPI */
+#undef	CONFIG_OMAP3_SPI
+#define CONFIG_TI_QSPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SPANSION
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH_BAR
+#define CONFIG_TI_SPI_MMAP
+#define CONFIG_SF_DEFAULT_SPEED                48000000
+#define CONFIG_DEFAULT_SPI_MODE                SPI_MODE_3
+
+/*
+ * Default to using SPI for environment, etc.
+ * 0x000000 - 0x010000 : QSPI.SPL (64KiB)
+ * 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB)
+ * 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB)
+ * 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB)
+ * 0x040000 - 0x140000 : QSPI.u-boot (1MiB)
+ * 0x140000 - 0x1C0000 : QSPI.u-boot-spl-os (512KiB)
+ * 0x1C0000 - 0x1D0000 : QSPI.u-boot-env (64KiB)
+ * 0x1D0000 - 0x1E0000 : QSPI.u-boot-env.backup1 (64KiB)
+ * 0x1E0000 - 0x9E0000 : QSPI.kernel (8MiB)
+ * 0x9E0000 - 0x2000000 : USERLAND

include/configs/dra7xx_evm_android.h line 157

Quoted 10 lines
include/configs/dra7xx_evm_android.h new file +10 -0
+ */
+#define CONFIG_SYS_SPI_KERNEL_OFFS	0x1E0000
+#define CONFIG_SYS_SPI_ARGS_OFFS	0x140000
+#define CONFIG_SYS_SPI_ARGS_SIZE	0x80000
+#if defined(CONFIG_QSPI_BOOT)
+/* In SPL, use the environment and discard MMC support for space. */
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_SPL_MMC_SUPPORT
+#undef CONFIG_SPL_MAX_SIZE
+#define CONFIG_SPL_MAX_SIZE             (64 << 10) /* 64 KiB */
					          SZ_1K
			Please use globally.
Quoted 158 lines
include/configs/dra7xx_evm_android.h new file +7 -0
+#endif
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SIZE			(64 << 10)
+#define CONFIG_ENV_SECT_SIZE		(64 << 10) /* 64 KB

sectors */ +#define CONFIG_ENV_OFFSET 0x1C0000

include/configs/dra7xx_evm_android.h new file +61 -0
+#define CONFIG_ENV_OFFSET_REDUND	0x1D0000
+#endif
+
+/* SPI SPL */
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_DMA_SUPPORT
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_TI_EDMA
+#endif
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_BUS             0
+#define CONFIG_SPL_SPI_CS              0
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+
+#define CONFIG_SUPPORT_EMMC_BOOT
+
+/* USB xHCI HOST */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_XHCI
+#define CONFIG_USB_XHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
+
+#define CONFIG_OMAP_USB_PHY
+#define CONFIG_OMAP_USB2PHY2_HOST
+
+/* USB GADGET */
+#define CONFIG_USB_DWC3_PHY_OMAP
+#define CONFIG_USB_DWC3_OMAP
+#define CONFIG_USB_DWC3
+#define CONFIG_USB_DWC3_GADGET
+
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#define CONFIG_USB_GADGET_DUALSPEED
+
+/* USB Device Firmware Update support */
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_RAM
+#define CONFIG_CMD_DFU
+
+#define CONFIG_DFU_MMC
+#define CONFIG_DFU_RAM
+
+/* SATA */
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_CMD_SCSI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
+#define CONFIG_SYS_SCSI_MAX_LUN		1
+#define CONFIG_SYS_SCSI_MAX_DEVICE

(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+
CONFIG_SYS_SCSI_MAX_LUN) +

include/configs/dra7xx_evm_android.h new file +8 -0
+/* NAND support */
+#ifdef CONFIG_NAND
+/* NAND: device related configs */
+#define CONFIG_SYS_NAND_PAGE_SIZE	2048
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
+#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
+#define CONFIG_SYS_NAND_PAGE_COUNT

(CONFIG_SYS_NAND_BLOCK_SIZE / \

include/configs/dra7xx_evm_android.h new file +9 -0
+					 CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+/* NAND: driver related configs */
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_NAND_OMAP_ELM
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8,

9, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 10, 11, 12, 13, 14, 15, 16,

17, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 18, 19, 20, 21, 22, 23, 24,

25, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 26, 27, 28, 29, 30, 31, 32,

33, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 34, 35, 36, 37, 38, 39, 40,

41, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 42, 43, 44, 45, 46, 47, 48,

49, \

include/configs/dra7xx_evm_android.h new file +1 -0
+					 50, 51, 52, 53, 54, 55, 56,

57, } +#define CONFIG_SYS_NAND_ECCSIZE 512

include/configs/dra7xx_evm_android.h new file +11 -0
+#define CONFIG_SYS_NAND_ECCBYTES	14
+#define MTDIDS_DEFAULT			"nand0=nand.0"
+#define MTDPARTS_DEFAULT		"mtdparts=nand.0:" \
+					"128k(NAND.SPL)," \
+					"128k(NAND.SPL.backup1)," \
+					"128k(NAND.SPL.backup2)," \
+					"128k(NAND.SPL.backup3)," \
+					"256k(NAND.u-boot-spl-os)," \
+					"1m(NAND.u-boot)," \
+					"128k(NAND.u-boot-env)," \
+					"128k(NAND.u-boot-env.backup1),"

\

include/configs/dra7xx_evm_android.h new file +10 -0
+					"8m(NAND.kernel)," \
+					"-(NAND.file-system)"
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x000c0000
+/* NAND: SPL related configs */
+#ifdef CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_AM33XX_BCH
+#endif
+/* NAND: SPL falcon mode configs */
+#ifdef CONFIG_SPL_OS_BOOT
+#define CONFIG_CMD_SPL_NAND_OFS		0x00080000 /* os-boot

params*/ +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS
0x00200000 /* kernel offset */ +#define
CONFIG_CMD_SPL_WRITE_SIZE 0x2000 +#endif

include/configs/dra7xx_evm_android.h new file +8 -0
+#endif /* !CONFIG_NAND */
+
+/* Parallel NOR Support */
+#if defined(CONFIG_NOR)
+/* NOR: device related configs */
+#define CONFIG_SYS_MAX_FLASH_SECT	512
+#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
+#define CONFIG_SYS_FLASH_SIZE		(64 * 1024 * 1024) /*

64 MB */ +/* #define CONFIG_INIT_IGNORE_ERROR */

include/configs/dra7xx_evm_android.h new file +14 -0
+#undef CONFIG_SYS_NO_FLASH
+#define CONFIG_CMD_FLASH
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#define CONFIG_SYS_FLASH_BASE		(0x08000000)
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+/* Reduce SPL size by removing unlikey targets */
+#ifdef CONFIG_NOR_BOOT
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SECT_SIZE		(128 * 1024)	/*

128 KiB */ +#define
MTDIDS_DEFAULT "nor0=physmap-flash.0" +#define
MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:" \

include/configs/dra7xx_evm_android.h new file +3 -0
+					"1m(NOR.u-boot)," \
+					"128k(NOR.u-boot-env)," \
+					"128k(NOR.u-boot-env.backup1),"

\

include/configs/dra7xx_evm_android.h line 313

Quoted 9 lines
include/configs/dra7xx_evm_android.h new file +9 -0
+					"256k(NOR.u-boot-spl-os)," \
+					"8m(NOR.kernel)," \
+					"-(NOR.rootfs)"
+#define CONFIG_ENV_OFFSET		0x00100000
+#define CONFIG_ENV_OFFSET_REDUND	0x00120000
+#endif
+#endif  /* NOR support */
+
+#endif /* __CONFIG_DRA7XX_EVM_ANDROID_H */

Despite some minor comments,

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#28 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

In reply to Dileep Katta
Quoted 11 lines · Dileep Katta
---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313 +++++++++++++++++++++++++++++++++++
 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h

I _really_ don't like how we're duplicating large hunks of dra7xx_evm.h. The first question is, what parts of this are not appropriate to just do in dra7xx_evm.h directly? And the second question would be, which of those cannot simply be done via Kconfig choices.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150304/922eae41/attachment.sig>
#29 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

Hi Tom and Lukasz,

Quoted 15 lines · Tom Rini
Quoted 8 lines · Dileep Katta
---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313

+++++++++++++++++++++++++++++++++++

Quoted 3 lines
 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h
Quoted 8 lines

I _really_ don't like how we're duplicating large hunks of dra7xx_evm.h. The first question is, what parts of this are not appropriate to just do in dra7xx_evm.h directly? And the second question would be, which of those cannot simply be done via Kconfig choices.

--
Tom

Discussed this with Angela from TI, and arrived at a common header file so that the duplication could be avoided. Will send a follow-up patch with the update.
Thanks for the comments.

Regards, Dileep

#30 lore raw

PATCH 1/4 ARM: DRA7XX: Add config file for Android with fastboot support

Quoted 19 lines · Dileep Katta

Hi Tom and Lukasz,

Quoted 15 lines · Tom Rini
Quoted 8 lines · Dileep Katta
---
 arch/arm/cpu/armv7/omap5/Kconfig     |   5 +
 board/ti/dra7xx/Kconfig              |  13 ++
 board/ti/dra7xx/MAINTAINERS          |   2 +
 configs/dra7xx_evm_android_defconfig |   5 +
 include/configs/dra7xx_evm_android.h | 313

+++++++++++++++++++++++++++++++++++

Quoted 3 lines
 5 files changed, 338 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
 create mode 100644 include/configs/dra7xx_evm_android.h
Quoted 8 lines
Quoted 4 lines

I _really_ don't like how we're duplicating large hunks of dra7xx_evm.h. The first question is, what parts of this are not appropriate to just do in dra7xx_evm.h directly? And the second question would be, which of those cannot simply be done via Kconfig choices.

Discussed this with Angela from TI, and arrived at a common header file so that the duplication could be avoided. Will send a follow-up patch with the update.

Note that I'm still skeptical that there's things that can't just be Kconfig choices and the rest just be in dra7xx_evm.h. Sort out and come up with a common flash/etc layout and so forth. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150312/ed8fe5c6/attachment.sig>
#31 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

---
Changes in v2:
- Merged the header file content to existing dra7xx_evm.h to avoid duplication
- Removed unnecessary definitions as per comments

 board/ti/dra7xx/MAINTAINERS          |  1 +
 configs/dra7xx_evm_android_defconfig |  5 +++++
 include/configs/dra7xx_evm.h         | 30 ++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
board/ti/dra7xx/MAINTAINERS +1 -0
index 5ec6769..1b5ae71 100644
@@ -6,3 +6,4 @@ F:	include/configs/dra7xx_evm.h
 F:	configs/dra7xx_evm_defconfig
 F:	configs/dra7xx_evm_qspiboot_defconfig
 F:	configs/dra7xx_evm_uart3_defconfig
+F:	configs/dra7xx_evm_android_defconfig
configs/dra7xx_evm_android_defconfig new file +5 -0
new file mode 100644
index 0000000..5fdce85
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,DRA7XX_ANDROID"
++S:CONFIG_ARM=y
++S:CONFIG_OMAP54XX=y
++S:CONFIG_TARGET_DRA7XX_EVM=y
include/configs/dra7xx_evm.h +30 -0
index dee2b11..dd20e08 100644
@@ -43,6 +43,16 @@
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#ifdef CONFIG_DRA7XX_ANDROID
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif
 
 #define CONFIG_SUPPORT_EMMC_BOOT
 
@@ -130,6 +144,22 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB2PHY2_HOST
 
+/* USB GADGET */
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED
+
 /* SATA */
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_CMD_SCSI
Signature · 1 line
1.8.3.2
#32 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

Quoted 6 lines · Dileep Katta

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

[snip]

Quoted 5 lines
include/configs/dra7xx_evm.h +1 -0
@@ -43,6 +43,16 @@
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#ifdef CONFIG_DRA7XX_ANDROID

include/configs/dra7xx_evm.h line 56

Quoted 10 lines
include/configs/dra7xx_evm.h +9 -0
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>

No, just enable fastboot. There's a growing population of people whose workflow is "use fastboot to shove a new test kernel at my device" that aren't strictly using Android, lets enable them.

include/configs/dra7xx_evm.h line 132

Quoted 9 lines
include/configs/dra7xx_evm.h +4 -0
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif

Why are you moving U-Boot so much higher in SPI flash?

include/configs/dra7xx_evm.h line 150

Quoted 8 lines
include/configs/dra7xx_evm.h +4 -0
@@ -130,6 +144,22 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB2PHY2_HOST
 
+/* USB GADGET */
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY

This board doesn't have MUSB, DWC3 only.

include/configs/dra7xx_evm.h line 161

Quoted 11 lines
include/configs/dra7xx_evm.h +11 -0
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED

Why can't we always use one vid/pid?

Signature · 1 line
Tom
#33 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

Hi Tom,

Quoted 14 lines · Tom Rini
Quoted 3 lines · Dileep Katta

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly

http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Quoted 3 lines

[snip]

Quoted 4 lines
include/configs/dra7xx_evm.h +0 -0
@@ -43,6 +43,16 @@
      "uuid_disk=${uuid_gpt_disk};" \
      "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
Quoted 16 lines

include/configs/dra7xx_evm.h line 56

Quoted 11 lines
include/configs/dra7xx_evm.h +10 -0
+#ifdef CONFIG_DRA7XX_ANDROID
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>

No, just enable fastboot. There's a growing population of people whose workflow is "use fastboot to shove a new test kernel at my device" that aren't strictly using Android, lets enable them.

OK, will enable fastboot unconditional.
Now there is no much difference for android_defconfig, but will still keep separate config for future changes.

Quoted 13 lines

include/configs/dra7xx_evm.h line 132

Quoted 10 lines
include/configs/dra7xx_evm.h +4 -0
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif

Why are you moving U-Boot so much higher in SPI flash?

This is done to accommodate larger size MLO.

Quoted 5 lines
Quoted 5 lines
include/configs/dra7xx_evm.h +0 -0
@@ -130,6 +144,22 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB2PHY2_HOST
 
Quoted 7 lines

include/configs/dra7xx_evm.h line 150

Quoted 4 lines
include/configs/dra7xx_evm.h +4 -0
+/* USB GADGET */
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY

This board doesn't have MUSB, DWC3 only.

Thanks. DWC3 is enabled in dwc3_gadget developer branch of DFU custodian tree.
Will submit the updated patch on top of the same

Quoted 15 lines

include/configs/dra7xx_evm.h line 161

Quoted 12 lines
include/configs/dra7xx_evm.h +11 -0
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED

Why can't we always use one vid/pid?

As we are restricted to use the vid which fastboot host application knows, the other/original
vid/pid kept intact for the dependent functionality, if any. Will check if 0x0403/0xBD00 could be removed.

Quoted 4 lines

--
Tom

Regards, Dileep

#34 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

Quoted 34 lines · Dileep Katta

Hi Tom,

Quoted 14 lines · Tom Rini
Quoted 3 lines · Dileep Katta

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly

http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Quoted 3 lines

[snip]

Quoted 4 lines
include/configs/dra7xx_evm.h +0 -0
@@ -43,6 +43,16 @@
      "uuid_disk=${uuid_gpt_disk};" \
      "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
Quoted 16 lines

include/configs/dra7xx_evm.h line 56

Quoted 11 lines
include/configs/dra7xx_evm.h +10 -0
+#ifdef CONFIG_DRA7XX_ANDROID
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>

No, just enable fastboot. There's a growing population of people whose workflow is "use fastboot to shove a new test kernel at my device" that aren't strictly using Android, lets enable them.

Quoted 3 lines

OK, will enable fastboot unconditional.
Now there is no much difference for android_defconfig, but will still keep separate config for future changes.

I remain unconvinced that we need a separate config upstream still.

Quoted 12 lines
Quoted 11 lines

include/configs/dra7xx_evm.h line 132

Quoted 9 lines
include/configs/dra7xx_evm.h +4 -0
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif

Why are you moving U-Boot so much higher in SPI flash?

Quoted 1 line

This is done to accommodate larger size MLO.

Oh that's right. Some parts can be made with a larger SRAM and thus we could use a larger MLO. But are we? What functionality would we be shoving into a larger MLO that would make sense to do this really? Frankly I had been thinking that in these parts it makes more sense to jump to full U-Boot and skip SPL rather than make SPL be very complicated.

Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
include/configs/dra7xx_evm.h +5 -0
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
Quoted 9 lines

include/configs/dra7xx_evm.h line 161

Quoted 6 lines
include/configs/dra7xx_evm.h +6 -0
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED

Why can't we always use one vid/pid?

Quoted 4 lines

As we are restricted to use the vid which fastboot host application knows, the other/original
vid/pid kept intact for the dependent functionality, if any. Will check if 0x0403/0xBD00 could be removed.

I think we can just always use the VID/PID that fastboot knows, DFU isn't nearly so picky and other gadget use cases don't care I believe.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150319/3dd09668/attachment.sig>
#35 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

Hi Tom,

Quoted 36 lines · Tom Rini
Quoted 10 lines · Dileep Katta

Hi Tom,

Quoted 6 lines · Tom Rini
Quoted 3 lines · Dileep Katta

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly

http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Quoted 24 lines
Quoted 24 lines
Quoted 3 lines

[snip]

Quoted 5 lines
include/configs/dra7xx_evm.h +1 -0
@@ -43,6 +43,16 @@
      "uuid_disk=${uuid_gpt_disk};" \
      "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#ifdef CONFIG_DRA7XX_ANDROID

include/configs/dra7xx_evm.h line 56

Quoted 10 lines
include/configs/dra7xx_evm.h +9 -0
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>

No, just enable fastboot. There's a growing population of people whose workflow is "use fastboot to shove a new test kernel at my device" that aren't strictly using Android, lets enable them.

Quoted 7 lines
Quoted 2 lines

OK, will enable fastboot unconditional.
Now there is no much difference for android_defconfig, but will still

keep

Quoted 1 line

separate config for future changes.

I remain unconvinced that we need a separate config upstream still.

Will remove separate config.

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

include/configs/dra7xx_evm.h line 132

Quoted 10 lines
include/configs/dra7xx_evm.h +4 -0
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif

Why are you moving U-Boot so much higher in SPI flash?

Quoted 9 lines
Quoted 1 line

This is done to accommodate larger size MLO.

Oh that's right. Some parts can be made with a larger SRAM and thus we could use a larger MLO. But are we? What functionality would we be shoving into a larger MLO that would make sense to do this really? Frankly I had been thinking that in these parts it makes more sense to jump to full U-Boot and skip SPL rather than make SPL be very complicated.

Strictly speaking, its not required now, and can be changed when required.

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

include/configs/dra7xx_evm.h line 161

Quoted 12 lines
include/configs/dra7xx_evm.h +11 -0
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED

Why can't we always use one vid/pid?

Quoted 9 lines
Quoted 1 line

As we are restricted to use the vid which fastboot host application

knows,

Quoted 3 lines

the other/original
vid/pid kept intact for the dependent functionality, if any. Will check if 0x0403/0xBD00 could be removed.

I think we can just always use the VID/PID that fastboot knows, DFU isn't nearly so picky and other gadget use cases don't care I believe.

Will use fastboot aware VID/PID pair, always.

Quoted 4 lines

--
Tom

Regards, Dileep

#36 lore raw

PATCH v3 1/3 ARM: DRA7XX: Enable Fastboot

- Fastboot is enable by default for DRA7XX
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

---
Changes in v2:
- Merged the header file content to existing dra7xx_evm.h to avoid duplication
- Removed unnecessary definitions as per comments
Changes in v3:
- Added the changes on dwc3_gadget developer branch of DFU tree
- Added the changes as part of existing dra7xx_evm_defconfig
- Enabled fastboot by default
- Kept fastboot aware VID/PID only
- reverted change made for U-Boot offset

 include/configs/dra7xx_evm.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
include/configs/dra7xx_evm.h +10 -2
index e94b618..7acd907 100644
@@ -84,6 +84,14 @@
 	DFU_ALT_INFO_EMMC \
 	DFU_ALT_INFO_RAM
 
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
@@ -181,8 +189,8 @@
 #define CONFIG_USBDOWNLOAD_GADGET
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
-#define CONFIG_G_DNL_VENDOR_NUM 0x0403
-#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
 #define CONFIG_USB_GADGET_DUALSPEED
 
 /* USB Device Firmware Update support */
Signature · 1 line
1.8.3.2
#37 lore raw

PATCH v3 2/3 ARM: DRA7: Set serial number environment variable

This patch populates serial number environment variable from die_id_0 and die_id_1 register values for DRA7xx boards.

The function is added in omap common code so that this can be re-used.

Serial# environment variable will be useful to show correct information in "fastboot devices" commands.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=a6bcaaf67f6e4bcd97808f53d0ceb4b0c04d583c

---
Changes in v2:
- None
Changes in v3:
- corrected the error in the computation of serial# variable
- Made it more generic and reusable as per the comments

 arch/arm/cpu/armv7/omap-common/utils.c | 13 +++++++++++++
 arch/arm/cpu/armv7/omap5/prcm-regs.c   |  4 ++++
 arch/arm/include/asm/omap_common.h     |  5 +++++
 board/ti/dra7xx/evm.c                  |  6 ++++++
 4 files changed, 28 insertions(+)
arch/arm/cpu/armv7/omap-common/utils.c +13 -0
index 1696c2d..df5f817 100644
@@ -60,3 +60,16 @@ void __weak usb_fake_mac_from_die_id(u32 *id)
 		eth_setenv_enetaddr("usbethaddr", device_mac);
 	}
 }
+
+void __weak usb_set_serial_num_from_die_id(u32 *id)
+{
+	char serialno[72];
+	uint32_t serialno_lo, serialno_hi;
+
+	if (!getenv("serial#")) {
+		serialno_hi = id[0];
+		serialno_lo = id[1];
+		sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
+		setenv("serial#", serialno);
+	}
+}
arch/arm/cpu/armv7/omap5/prcm-regs.c +4 -0
index 440bb40..f80d36d 100644
@@ -440,6 +440,10 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
 	.control_emif1_sdram_config_ext		= 0x4AE0C144,
 	.control_emif2_sdram_config_ext		= 0x4AE0C148,
 	.control_wkup_ldovbb_mpu_voltage_ctrl	= 0x4AE0C158,
+	.control_std_fuse_die_id_0		= 0x4AE0C200,
+	.control_std_fuse_die_id_1		= 0x4AE0C208,
+	.control_std_fuse_die_id_2		= 0x4AE0C20C,
+	.control_std_fuse_die_id_3		= 0x4AE0C210,
 	.control_padconf_mode			= 0x4AE0C5A0,
 	.control_xtal_oscillator		= 0x4AE0C5A4,
 	.control_i2c_2				= 0x4AE0C5A8,
arch/arm/include/asm/omap_common.h +5 -0
index bd43099..13a57ab 100644
@@ -362,6 +362,10 @@ struct omap_sys_ctrl_regs {
 	u32 control_core_control_io1;
 	u32 control_core_control_io2;
 	u32 control_id_code;
+	u32 control_std_fuse_die_id_0;
+	u32 control_std_fuse_die_id_1;
+	u32 control_std_fuse_die_id_2;
+	u32 control_std_fuse_die_id_3;
 	u32 control_std_fuse_opp_bgap;
 	u32 control_ldosram_iva_voltage_ctrl;
 	u32 control_ldosram_mpu_voltage_ctrl;
@@ -578,6 +582,7 @@ void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control,
 s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb);
 
 void usb_fake_mac_from_die_id(u32 *id);
+void usb_set_serial_num_from_die_id(u32 *id);
 
 /* ABB */
 #define OMAP_ABB_NOMINAL_OPP		0
board/ti/dra7xx/evm.c +6 -0
index 3089fa2..cadff5a 100644
@@ -93,10 +93,16 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+	u32 id[4];
+
 	if (omap_revision() == DRA722_ES1_0)
 		setenv("board_name", "dra72x");
 	else
 		setenv("board_name", "dra7xx");
+
+	id[0] = readl((*ctrl)->control_std_fuse_die_id_0);
+	id[1] = readl((*ctrl)->control_std_fuse_die_id_1);
+	usb_set_serial_num_from_die_id(id);
 #endif
 	return 0;
 }
Signature · 1 line
1.8.3.2
#38 lore raw

PATCH v3 2/3 ARM: DRA7: Set serial number environment variable

Quoted 5 lines · Dileep Katta

This patch populates serial number environment variable from die_id_0 and die_id_1 register values for DRA7xx boards.

The function is added in omap common code so that this can be re-used.

Quoted 8 lines

Serial# environment variable will be useful to show correct information in "fastboot devices" commands.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=a6bcaaf67f6e4bcd97808f53d0ceb4b0c04d583c

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150327/982c85c1/attachment.sig>
#39 lore raw

PATCH v3 2/3 ARM: DRA7: Set serial number environment variable

In reply to Dileep Katta
Quoted 8 lines · Dileep Katta

This patch populates serial number environment variable from die_id_0 and die_id_1 register values for DRA7xx boards.

The function is added in omap common code so that this can be re-used.

Serial# environment variable will be useful to show correct information in "fastboot devices" commands.

Quoted 6 lines

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=a6bcaaf67f6e4bcd97808f53d0ceb4b0c04d583c

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150423/05cf1beb/attachment.sig>
#40 lore raw

PATCH v3 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

In reply to Dileep Katta

Implemented fb_set_reboot_flag() for OMAP5 to set
an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply.

This was originally intended for DRA7 platform, but now applies to all OMAP5.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=19da2e436e9806259cf1f4988b9e046ab256bf2c

---
Changes in v2:
- None
Changes in v3:
- Changed the implementation to be more abstract
- Used environment variable instead of board-specific registers
- Moved the code to OMAP5

 arch/arm/cpu/armv7/omap-common/boot-common.c | 11 +++++++++++
 include/configs/ti_omap5_common.h            |  7 +++++++
 2 files changed, 18 insertions(+)
arch/arm/cpu/armv7/omap-common/boot-common.c +11 -0
index 17500f2..1aff7c8 100644
@@ -162,3 +162,14 @@ void arch_preboot_os(void)
 	ahci_reset(DWC_AHSATA_BASE);
 }
 #endif
+
+#ifdef CONFIG_CMD_FASTBOOT
+int fb_set_reboot_flag(void)
+{
+	printf("Setting reboot to fastboot flag ...\n");
+	setenv("dofastboot", "1");
+	saveenv();
+	udelay(60);
+	return 0;
+}
+#endif
include/configs/ti_omap5_common.h +7 -0
index cd92454..c5d97ea 100644
@@ -141,13 +141,20 @@
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \
 	DFUARGS \
 
+
 #define CONFIG_BOOTCOMMAND \
+	"if test ${dofastboot} -eq 1; then " \
+		"echo Boot fastboot requested, resetting dofastboot ...;" \
+		"setenv dofastboot 0; saveenv; sleep 1;" \
+		"echo Booting into fastboot ...; fastboot;" \
+	"fi;" \
 	"run findfdt; " \
 	"run mmcboot;" \
 	"setenv mmcdev 1; " \
 	"setenv bootpart 1:2; " \
 	"setenv mmcroot /dev/mmcblk0p2 rw; " \
 	"run mmcboot;" \
+	""
 
 
 /*
Signature · 1 line
1.8.3.2
#41 lore raw

PATCH v3 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

Quoted 7 lines · Dileep Katta

Implemented fb_set_reboot_flag() for OMAP5 to set
an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply.

[snip]

Quoted 4 lines
arch/arm/cpu/armv7/omap-common/boot-common.c +4 -0
+	printf("Setting reboot to fastboot flag ...\n");
+	setenv("dofastboot", "1");
+	saveenv();
+	udelay(60);

[snip]

include/configs/ti_omap5_common.h line 149

Quoted 5 lines

#define CONFIG_BOOTCOMMAND \

include/configs/ti_omap5_common.h +4 -0
+	"if test ${dofastboot} -eq 1; then " \
+		"echo Boot fastboot requested, resetting dofastboot ...;" \
+		"setenv dofastboot 0; saveenv; sleep 1;" \
+		"echo Booting into fastboot ...; fastboot;" \

No. When saveenv returns environment is saved. If it doesn't there's a bug that must be addressed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150327/04be634e/attachment.sig>
#42 lore raw

PATCH v3 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

Quoted 16 lines · Tom Rini
Quoted 8 lines · Dileep Katta

Implemented fb_set_reboot_flag() for OMAP5 to set
an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific
command, then these changes will not apply.

[snip]

Quoted 4 lines
arch/arm/cpu/armv7/omap-common/boot-common.c +4 -0
+	printf("Setting reboot to fastboot flag ...\n");
+	setenv("dofastboot", "1");
+	saveenv();
+	udelay(60);

[snip]

Quoted 8 lines

include/configs/ti_omap5_common.h line 149

Quoted 5 lines

#define CONFIG_BOOTCOMMAND \

include/configs/ti_omap5_common.h +4 -0
+	"if test ${dofastboot} -eq 1; then " \
+		"echo Boot fastboot requested, resetting dofastboot ...;" \
+		"setenv dofastboot 0; saveenv; sleep 1;" \
+		"echo Booting into fastboot ...; fastboot;" \

No. When saveenv returns environment is saved. If it doesn't there's a bug that must be addressed.

sleep/udelay not required. Will remove and send an updated patch.

Quoted 4 lines

--
Tom

Thanks for the comment.
Regards, Dileep

#43 lore raw

PATCH v4 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

Implemented fb_set_reboot_flag() for OMAP5 to set
an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply.

This was originally intended for DRA7 platform, but now applies to all OMAP5.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=19da2e436e9806259cf1f4988b9e046ab256bf2c

---
Changes in v2:
- None
Changes in v3:
- Changed the implementation to be more abstract
- Used environment variable instead of board-specific registers
- Moved the code to OMAP5
Changes in v4:
- Removed udelay and sleep after saveenv

 arch/arm/cpu/armv7/omap-common/boot-common.c | 10 ++++++++++
 include/configs/ti_omap5_common.h            |  7 +++++++
 2 files changed, 17 insertions(+)
arch/arm/cpu/armv7/omap-common/boot-common.c +10 -0
index 17500f2..55ca94d 100644
@@ -162,3 +162,13 @@ void arch_preboot_os(void)
 	ahci_reset(DWC_AHSATA_BASE);
 }
 #endif
+
+#ifdef CONFIG_CMD_FASTBOOT
+int fb_set_reboot_flag(void)
+{
+	printf("Setting reboot to fastboot flag ...\n");
+	setenv("dofastboot", "1");
+	saveenv();
+	return 0;
+}
+#endif
include/configs/ti_omap5_common.h +7 -0
index cd92454..24f8021 100644
@@ -141,13 +141,20 @@
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \
 	DFUARGS \
 
+
 #define CONFIG_BOOTCOMMAND \
+	"if test ${dofastboot} -eq 1; then " \
+		"echo Boot fastboot requested, resetting dofastboot ...;" \
+		"setenv dofastboot 0; saveenv;" \
+		"echo Booting into fastboot ...; fastboot;" \
+	"fi;" \
 	"run findfdt; " \
 	"run mmcboot;" \
 	"setenv mmcdev 1; " \
 	"setenv bootpart 1:2; " \
 	"setenv mmcroot /dev/mmcblk0p2 rw; " \
 	"run mmcboot;" \
+	""
 
 
 /*
Signature · 1 line
1.8.3.2
#44 lore raw

PATCH v4 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

Quoted 8 lines · Dileep Katta

Implemented fb_set_reboot_flag() for OMAP5 to set
an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply.

Quoted 7 lines

This was originally intended for DRA7 platform, but now applies to all OMAP5.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=19da2e436e9806259cf1f4988b9e046ab256bf2c

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150327/186c3cad/attachment.sig>
#45 lore raw

PATCH v4 3/3 fastboot: ARM: OMAP5: Enable reboot-bootloader

In reply to Dileep Katta
Quoted 9 lines · Dileep Katta

Implemented fb_set_reboot_flag() for OMAP5 to set

an environment variable 'dofastboot' when reboot-bootloader called.

This environment variable will be checked in boot command and fastboot will be called if the variable is set.
If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply.

Quoted 8 lines

This was originally intended for DRA7 platform, but now applies to all OMAP5.

Ref:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=19da2e436e9806259cf1f4988b9e046ab256bf2c

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150423/0c20527f/attachment.sig>
#46 lore raw

PATCH v3 1/3 ARM: DRA7XX: Enable Fastboot

In reply to Dileep Katta
Quoted 6 lines · Dileep Katta

- Fastboot is enable by default for DRA7XX
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150327/791f9c90/attachment.sig>
#47 lore raw

PATCH v3 1/3 ARM: DRA7XX: Enable Fastboot

In reply to Dileep Katta
Quoted 7 lines · Dileep Katta

- Fastboot is enable by default for DRA7XX
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150423/29a57da6/attachment.sig>
#48 lore raw

PATCH v2 1/1 ARM: DRA7XX: Add config file for Android with fastboot support

In reply to Dileep Katta

Hi Dileep,

Quoted 84 lines

- Added new configuration for Android fastboot
- This is based on following patch modified accordingly
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

---
Changes in v2:
- Merged the header file content to existing dra7xx_evm.h to
avoid duplication
- Removed unnecessary definitions as per comments

 board/ti/dra7xx/MAINTAINERS          |  1 +
 configs/dra7xx_evm_android_defconfig |  5 +++++
 include/configs/dra7xx_evm.h         | 30
++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)
 create mode 100644 configs/dra7xx_evm_android_defconfig
board/ti/dra7xx/MAINTAINERS +1 -0
index 5ec6769..1b5ae71 100644
@@ -6,3 +6,4 @@ F:	include/configs/dra7xx_evm.h
 F:	configs/dra7xx_evm_defconfig
 F:	configs/dra7xx_evm_qspiboot_defconfig
 F:	configs/dra7xx_evm_uart3_defconfig
+F:	configs/dra7xx_evm_android_defconfig
(quoted diff) +0 -0

b/configs/dra7xx_evm_android_defconfig new file mode 100644 index 0000000..5fdce85

configs/dra7xx_evm_android_defconfig new file +5 -0
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,DRA7XX_ANDROID"
++S:CONFIG_ARM=y
++S:CONFIG_OMAP54XX=y
++S:CONFIG_TARGET_DRA7XX_EVM=y
(quoted diff) +0 -0

b/include/configs/dra7xx_evm.h index dee2b11..dd20e08 100644

include/configs/dra7xx_evm.h +23 -0
@@ -43,6 +43,16 @@
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#ifdef CONFIG_DRA7XX_ANDROID
+/* Fastboot */
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_USB_FASTBOOT_BUF_ADDR    CONFIG_SYS_LOAD_ADDR
+#define CONFIG_USB_FASTBOOT_BUF_SIZE    0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
+#endif
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
@@ -115,7 +125,11 @@
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
+#ifdef CONFIG_DRA7XX_ANDROID
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x80000
+#else
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#endif
 
 #define CONFIG_SUPPORT_EMMC_BOOT
 
@@ -130,6 +144,22 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB2PHY2_HOST
 
+/* USB GADGET */
+#define CONFIG_USB_GADGET
+#define CONFIG_MUSB_GADGET
+#define CONFIG_MUSB_PIO_ONLY
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+#ifdef CONFIG_CMD_FASTBOOT
+#define CONFIG_G_DNL_VENDOR_NUM 0x0451

include/configs/dra7xx_evm.h line 165

Quoted 10 lines
include/configs/dra7xx_evm.h +7 -0
+#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
+#else
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#endif
+#define CONFIG_USB_GADGET_DUALSPEED
+
 /* SATA */
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_CMD_SCSI
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group