All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] rockchip: kylin: Boot with android boot image
@ 2016-01-08 10:33 ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: Marek Vasut, Albert Aribaud, huang lin, Joe Hershberger,
	Jan Kiszka, sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen,
	Paul Kocialkowski,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Peng Fan,
	Tom Warren, Max Krummenacher, York Sun

We are porting android to kylin board now.
This series could let it boot up with android's boot image.

Changes in v2:
Add comments.

Jeffy Chen (6):
  common/image-fdt.c: Make boot_get_fdt() perform a check for Android
    images
  ARM: bootm: Try to use relocated ramdisk
  rockchip: rk3036: Bind GPIO banks
  rockchip: kylin: Add default gpt partition table
  rockchip: kylin: Enable boot with android boot image
  rockchip: kylin: Check fastboot request

 arch/arm/lib/bootm.c                      | 12 ++++++-
 board/kylin/kylin_rk3036/kylin_rk3036.c   | 32 ++++++++++++++++++
 common/image-fdt.c                        |  4 +++
 drivers/pinctrl/rockchip/pinctrl_rk3036.c |  8 +++++
 include/configs/kylin_rk3036.h            | 55 +++++++++++++++++++++++++++++++
 5 files changed, 110 insertions(+), 1 deletion(-)

-- 
2.1.4

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

* [U-Boot] [PATCH v2 0/6] rockchip: kylin: Boot with android boot image
@ 2016-01-08 10:33 ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

We are porting android to kylin board now.
This series could let it boot up with android's boot image.

Changes in v2:
Add comments.

Jeffy Chen (6):
  common/image-fdt.c: Make boot_get_fdt() perform a check for Android
    images
  ARM: bootm: Try to use relocated ramdisk
  rockchip: rk3036: Bind GPIO banks
  rockchip: kylin: Add default gpt partition table
  rockchip: kylin: Enable boot with android boot image
  rockchip: kylin: Check fastboot request

 arch/arm/lib/bootm.c                      | 12 ++++++-
 board/kylin/kylin_rk3036/kylin_rk3036.c   | 32 ++++++++++++++++++
 common/image-fdt.c                        |  4 +++
 drivers/pinctrl/rockchip/pinctrl_rk3036.c |  8 +++++
 include/configs/kylin_rk3036.h            | 55 +++++++++++++++++++++++++++++++
 5 files changed, 110 insertions(+), 1 deletion(-)

-- 
2.1.4

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

* [PATCH v2 1/6] common/image-fdt.c: Make boot_get_fdt() perform a check for Android images
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: Marek Vasut, Joe Hershberger, sjg-F7+t8E8rja9g9hUCZPvPmw,
	Jeffy Chen, Paul Kocialkowski,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Peng Fan,
	Max Krummenacher

Android images don't have a fdt.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---

Changes in v2: None

 common/image-fdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 5e4e5bd..41aaa0d 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -379,6 +379,10 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
 				       (long)fdt_addr);
 			}
 			break;
+#ifdef CONFIG_ANDROID_BOOT_IMAGE
+		case IMAGE_FORMAT_ANDROID:
+			goto no_fdt;
+#endif
 		default:
 			puts("ERROR: Did not find a cmdline Flattened Device Tree\n");
 			goto no_fdt;
-- 
2.1.4

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

* [U-Boot] [PATCH v2 1/6] common/image-fdt.c: Make boot_get_fdt() perform a check for Android images
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

Android images don't have a fdt.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 common/image-fdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 5e4e5bd..41aaa0d 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -379,6 +379,10 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
 				       (long)fdt_addr);
 			}
 			break;
+#ifdef CONFIG_ANDROID_BOOT_IMAGE
+		case IMAGE_FORMAT_ANDROID:
+			goto no_fdt;
+#endif
 		default:
 			puts("ERROR: Did not find a cmdline Flattened Device Tree\n");
 			goto no_fdt;
-- 
2.1.4

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

* [PATCH v2 2/6] ARM: bootm: Try to use relocated ramdisk
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: Albert Aribaud, Joe Hershberger, Jan Kiszka,
	sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Peng Fan,
	Tom Warren, York Sun

After boot_ramdisk_high(), ramdisk would be relocated to
initrd_start & initrd_end, so use them instead of rd_start & rd_end.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

---

Changes in v2:
Add comments.

 arch/arm/lib/bootm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index a477cae..0838d89 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -225,7 +225,17 @@ static void boot_prep_linux(bootm_headers_t *images)
 		if (BOOTM_ENABLE_MEMORY_TAGS)
 			setup_memory_tags(gd->bd);
 		if (BOOTM_ENABLE_INITRD_TAG) {
-			if (images->rd_start && images->rd_end) {
+			/*
+			 * In boot_ramdisk_high(), it may relocate ramdisk to
+			 * a specified location. And set images->initrd_start &
+			 * images->initrd_end to relocated ramdisk's start/end
+			 * addresses. So use them instead of images->rd_start &
+			 * images->rd_end when possible.
+			 */
+			if (images->initrd_start && images->initrd_end) {
+				setup_initrd_tag(gd->bd, images->initrd_start,
+						 images->initrd_end);
+			} else if (images->rd_start && images->rd_end) {
 				setup_initrd_tag(gd->bd, images->rd_start,
 						 images->rd_end);
 			}
-- 
2.1.4

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

* [U-Boot] [PATCH v2 2/6] ARM: bootm: Try to use relocated ramdisk
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

After boot_ramdisk_high(), ramdisk would be relocated to
initrd_start & initrd_end, so use them instead of rd_start & rd_end.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

---

Changes in v2:
Add comments.

 arch/arm/lib/bootm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index a477cae..0838d89 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -225,7 +225,17 @@ static void boot_prep_linux(bootm_headers_t *images)
 		if (BOOTM_ENABLE_MEMORY_TAGS)
 			setup_memory_tags(gd->bd);
 		if (BOOTM_ENABLE_INITRD_TAG) {
-			if (images->rd_start && images->rd_end) {
+			/*
+			 * In boot_ramdisk_high(), it may relocate ramdisk to
+			 * a specified location. And set images->initrd_start &
+			 * images->initrd_end to relocated ramdisk's start/end
+			 * addresses. So use them instead of images->rd_start &
+			 * images->rd_end when possible.
+			 */
+			if (images->initrd_start && images->initrd_end) {
+				setup_initrd_tag(gd->bd, images->initrd_start,
+						 images->initrd_end);
+			} else if (images->rd_start && images->rd_end) {
 				setup_initrd_tag(gd->bd, images->rd_start,
 						 images->rd_end);
 			}
-- 
2.1.4

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

* [PATCH v2 3/6] rockchip: rk3036: Bind GPIO banks
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen, huang lin

Call dm_scan_fdt_node() in rk3036 pinctrl uclass binding.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---

Changes in v2: None

 drivers/pinctrl/rockchip/pinctrl_rk3036.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3036.c b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
index 581b096..1f78bf8 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3036.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
@@ -15,6 +15,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
 #include <dm/pinctrl.h>
+#include <dm/root.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -252,6 +253,12 @@ static struct pinctrl_ops rk3036_pinctrl_ops = {
 	.get_periph_id	= rk3036_pinctrl_get_periph_id,
 };
 
+static int rk3036_pinctrl_bind(struct udevice *dev)
+{
+	/* scan child GPIO banks */
+	return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+}
+
 static int rk3036_pinctrl_probe(struct udevice *dev)
 {
 	struct rk3036_pinctrl_priv *priv = dev_get_priv(dev);
@@ -272,5 +279,6 @@ U_BOOT_DRIVER(pinctrl_rk3036) = {
 	.of_match	= rk3036_pinctrl_ids,
 	.priv_auto_alloc_size = sizeof(struct rk3036_pinctrl_priv),
 	.ops		= &rk3036_pinctrl_ops,
+	.bind		= rk3036_pinctrl_bind,
 	.probe		= rk3036_pinctrl_probe,
 };
-- 
2.1.4

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

* [U-Boot] [PATCH v2 3/6] rockchip: rk3036: Bind GPIO banks
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

Call dm_scan_fdt_node() in rk3036 pinctrl uclass binding.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/pinctrl/rockchip/pinctrl_rk3036.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3036.c b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
index 581b096..1f78bf8 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3036.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3036.c
@@ -15,6 +15,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
 #include <dm/pinctrl.h>
+#include <dm/root.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -252,6 +253,12 @@ static struct pinctrl_ops rk3036_pinctrl_ops = {
 	.get_periph_id	= rk3036_pinctrl_get_periph_id,
 };
 
+static int rk3036_pinctrl_bind(struct udevice *dev)
+{
+	/* scan child GPIO banks */
+	return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+}
+
 static int rk3036_pinctrl_probe(struct udevice *dev)
 {
 	struct rk3036_pinctrl_priv *priv = dev_get_priv(dev);
@@ -272,5 +279,6 @@ U_BOOT_DRIVER(pinctrl_rk3036) = {
 	.of_match	= rk3036_pinctrl_ids,
 	.priv_auto_alloc_size = sizeof(struct rk3036_pinctrl_priv),
 	.ops		= &rk3036_pinctrl_ops,
+	.bind		= rk3036_pinctrl_bind,
 	.probe		= rk3036_pinctrl_probe,
 };
-- 
2.1.4

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

* [PATCH v2 4/6] rockchip: kylin: Add default gpt partition table
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen, huang lin

Add default android gpt partition table for kylin board.

Use "gpt write mmc 0 $partitions" to apply.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---

Changes in v2: None

 include/configs/kylin_rk3036.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index aa07889..b750b26 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -9,4 +9,33 @@
 
 #include <configs/rk3036_common.h>
 
+#ifndef CONFIG_SPL_BUILD
+
+/* Enable gpt partition table */
+#define CONFIG_CMD_GPT
+#define CONFIG_RANDOM_UUID
+#define CONFIG_EFI_PARTITION
+#define PARTS_DEFAULT \
+	"uuid_disk=${uuid_gpt_disk};" \
+	"name=loader,start=32K,size=4000K,uuid=${uuid_gpt_loader};" \
+	"name=reserved,size=64K,uuid=${uuid_gpt_reserved};" \
+	"name=misc,size=4M,uuid=${uuid_gpt_misc};" \
+	"name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \
+	"name=boot_a,size=32M,uuid=${uuid_gpt_boot_a};" \
+	"name=boot_b,size=32M,uuid=${uuid_gpt_boot_b};" \
+	"name=system_a,size=818M,uuid=${uuid_gpt_system_a};" \
+	"name=system_b,size=818M,uuid=${uuid_gpt_system_b};" \
+	"name=vendor_a,size=50M,uuid=${uuid_gpt_vendor_a};" \
+	"name=vendor_b,size=50M,uuid=${uuid_gpt_vendor_b};" \
+	"name=cache,size=100M,uuid=${uuid_gpt_cache};" \
+	"name=metadata,size=16M,uuid=${uuid_gpt_metadata};" \
+	"name=persist,size=4M,uuid=${uuid_gpt_persist};" \
+	"name=userdata,size=-,uuid=${uuid_gpt_userdata};\0" \
+
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"partitions=" PARTS_DEFAULT \
+
+#endif
+
 #endif
-- 
2.1.4

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

* [U-Boot] [PATCH v2 4/6] rockchip: kylin: Add default gpt partition table
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

Add default android gpt partition table for kylin board.

Use "gpt write mmc 0 $partitions" to apply.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 include/configs/kylin_rk3036.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index aa07889..b750b26 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -9,4 +9,33 @@
 
 #include <configs/rk3036_common.h>
 
+#ifndef CONFIG_SPL_BUILD
+
+/* Enable gpt partition table */
+#define CONFIG_CMD_GPT
+#define CONFIG_RANDOM_UUID
+#define CONFIG_EFI_PARTITION
+#define PARTS_DEFAULT \
+	"uuid_disk=${uuid_gpt_disk};" \
+	"name=loader,start=32K,size=4000K,uuid=${uuid_gpt_loader};" \
+	"name=reserved,size=64K,uuid=${uuid_gpt_reserved};" \
+	"name=misc,size=4M,uuid=${uuid_gpt_misc};" \
+	"name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \
+	"name=boot_a,size=32M,uuid=${uuid_gpt_boot_a};" \
+	"name=boot_b,size=32M,uuid=${uuid_gpt_boot_b};" \
+	"name=system_a,size=818M,uuid=${uuid_gpt_system_a};" \
+	"name=system_b,size=818M,uuid=${uuid_gpt_system_b};" \
+	"name=vendor_a,size=50M,uuid=${uuid_gpt_vendor_a};" \
+	"name=vendor_b,size=50M,uuid=${uuid_gpt_vendor_b};" \
+	"name=cache,size=100M,uuid=${uuid_gpt_cache};" \
+	"name=metadata,size=16M,uuid=${uuid_gpt_metadata};" \
+	"name=persist,size=4M,uuid=${uuid_gpt_persist};" \
+	"name=userdata,size=-,uuid=${uuid_gpt_userdata};\0" \
+
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"partitions=" PARTS_DEFAULT \
+
+#endif
+
 #endif
-- 
2.1.4

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

* [PATCH v2 5/6] rockchip: kylin: Enable boot with android boot image
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen, huang lin

The android kernel is using appended dtb by default, and store
ramdisk right after kernel & dtb.
So we needs to relocate ramdisk, and use atags to pass params.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---

Changes in v2: None

 include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index b750b26..49997ec 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -35,6 +35,29 @@
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"partitions=" PARTS_DEFAULT \
+	"mmcdev=0\0" \
+	"mmcpart=5\0" \
+	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_SYS_HUSH_PARSER
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"part start mmc ${mmcdev} ${mmcpart} boot_start;" \
+		"part size mmc ${mmcdev} ${mmcpart} boot_size;" \
+		"mmc read ${loadaddr} ${boot_start} ${boot_size};" \
+		"bootm start ${loadaddr}; bootm ramdisk;" \
+		"bootm prep; bootm go;" \
+	"fi;" \
+
+/* Enable atags */
+#define CONFIG_SYS_BOOTPARAMS_LEN	(64*1024)
+#define CONFIG_INITRD_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
 
 #endif
 
-- 
2.1.4

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

* [U-Boot] [PATCH v2 5/6] rockchip: kylin: Enable boot with android boot image
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

The android kernel is using appended dtb by default, and store
ramdisk right after kernel & dtb.
So we needs to relocate ramdisk, and use atags to pass params.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index b750b26..49997ec 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -35,6 +35,29 @@
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"partitions=" PARTS_DEFAULT \
+	"mmcdev=0\0" \
+	"mmcpart=5\0" \
+	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_SYS_HUSH_PARSER
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"part start mmc ${mmcdev} ${mmcpart} boot_start;" \
+		"part size mmc ${mmcdev} ${mmcpart} boot_size;" \
+		"mmc read ${loadaddr} ${boot_start} ${boot_size};" \
+		"bootm start ${loadaddr}; bootm ramdisk;" \
+		"bootm prep; bootm go;" \
+	"fi;" \
+
+/* Enable atags */
+#define CONFIG_SYS_BOOTPARAMS_LEN	(64*1024)
+#define CONFIG_INITRD_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
 
 #endif
 
-- 
2.1.4

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

* [PATCH v2 6/6] rockchip: kylin: Check fastboot request
  2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
@ 2016-01-08 10:33     ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sjg-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen, huang lin

We will save boot mode flag in grf's os_reg[0], if fastboot
requested or fastboot key pressed, try to enter fastboot mode
at preboot stage.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---

Changes in v2: None

 board/kylin/kylin_rk3036/kylin_rk3036.c | 32 ++++++++++++++++++++++++++++++++
 include/configs/kylin_rk3036.h          |  3 +++
 2 files changed, 35 insertions(+)

diff --git a/board/kylin/kylin_rk3036/kylin_rk3036.c b/board/kylin/kylin_rk3036/kylin_rk3036.c
index 40d6b52..df2c123 100644
--- a/board/kylin/kylin_rk3036/kylin_rk3036.c
+++ b/board/kylin/kylin_rk3036/kylin_rk3036.c
@@ -8,10 +8,15 @@
 #include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/uart.h>
+#include <asm/arch-rockchip/grf_rk3036.h>
 #include <asm/arch/sdram_rk3036.h>
+#include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define GRF_BASE	0x20008000
+static struct rk3036_grf * const grf = (void *)GRF_BASE;
+
 void get_ddr_config(struct rk3036_ddr_config *config)
 {
 	/* K4B4G1646Q config */
@@ -28,6 +33,33 @@ void get_ddr_config(struct rk3036_ddr_config *config)
 	config->bw = 1;
 }
 
+#define FASTBOOT_KEY_GPIO 93
+#define ROCKCHIP_BOOT_MODE_NORMAL	0
+#define ROCKCHIP_BOOT_MODE_FASTBOOT	1
+
+int fastboot_key_pressed(void)
+{
+	gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key");
+	gpio_direction_input(FASTBOOT_KEY_GPIO);
+	return !gpio_get_value(FASTBOOT_KEY_GPIO);
+}
+
+int board_late_init(void)
+{
+	int boot_mode = readl(&grf->os_reg[0]);
+
+	/* Clear boot mode */
+	writel(ROCKCHIP_BOOT_MODE_NORMAL, &grf->os_reg[0]);
+
+	if (boot_mode == ROCKCHIP_BOOT_MODE_FASTBOOT ||
+	    fastboot_key_pressed()) {
+		printf("enter fastboot!\n");
+		setenv("preboot", "setenv preboot; fastboot usb0");
+	}
+
+	return 0;
+}
+
 int board_init(void)
 {
 	return 0;
diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index 49997ec..424e81b 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -39,6 +39,9 @@
 	"mmcpart=5\0" \
 	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_PREBOOT
+
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_SYS_HUSH_PARSER
-- 
2.1.4

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

* [U-Boot] [PATCH v2 6/6] rockchip: kylin: Check fastboot request
@ 2016-01-08 10:33     ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-08 10:33 UTC (permalink / raw)
  To: u-boot

We will save boot mode flag in grf's os_reg[0], if fastboot
requested or fastboot key pressed, try to enter fastboot mode
at preboot stage.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 board/kylin/kylin_rk3036/kylin_rk3036.c | 32 ++++++++++++++++++++++++++++++++
 include/configs/kylin_rk3036.h          |  3 +++
 2 files changed, 35 insertions(+)

diff --git a/board/kylin/kylin_rk3036/kylin_rk3036.c b/board/kylin/kylin_rk3036/kylin_rk3036.c
index 40d6b52..df2c123 100644
--- a/board/kylin/kylin_rk3036/kylin_rk3036.c
+++ b/board/kylin/kylin_rk3036/kylin_rk3036.c
@@ -8,10 +8,15 @@
 #include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/uart.h>
+#include <asm/arch-rockchip/grf_rk3036.h>
 #include <asm/arch/sdram_rk3036.h>
+#include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define GRF_BASE	0x20008000
+static struct rk3036_grf * const grf = (void *)GRF_BASE;
+
 void get_ddr_config(struct rk3036_ddr_config *config)
 {
 	/* K4B4G1646Q config */
@@ -28,6 +33,33 @@ void get_ddr_config(struct rk3036_ddr_config *config)
 	config->bw = 1;
 }
 
+#define FASTBOOT_KEY_GPIO 93
+#define ROCKCHIP_BOOT_MODE_NORMAL	0
+#define ROCKCHIP_BOOT_MODE_FASTBOOT	1
+
+int fastboot_key_pressed(void)
+{
+	gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key");
+	gpio_direction_input(FASTBOOT_KEY_GPIO);
+	return !gpio_get_value(FASTBOOT_KEY_GPIO);
+}
+
+int board_late_init(void)
+{
+	int boot_mode = readl(&grf->os_reg[0]);
+
+	/* Clear boot mode */
+	writel(ROCKCHIP_BOOT_MODE_NORMAL, &grf->os_reg[0]);
+
+	if (boot_mode == ROCKCHIP_BOOT_MODE_FASTBOOT ||
+	    fastboot_key_pressed()) {
+		printf("enter fastboot!\n");
+		setenv("preboot", "setenv preboot; fastboot usb0");
+	}
+
+	return 0;
+}
+
 int board_init(void)
 {
 	return 0;
diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index 49997ec..424e81b 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -39,6 +39,9 @@
 	"mmcpart=5\0" \
 	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_PREBOOT
+
 #define CONFIG_ANDROID_BOOT_IMAGE
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_SYS_HUSH_PARSER
-- 
2.1.4

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

* Re: [PATCH v2 2/6] ARM: bootm: Try to use relocated ramdisk
  2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
@ 2016-01-11 16:58         ` Simon Glass
  -1 siblings, 0 replies; 18+ messages in thread
From: Simon Glass @ 2016-01-11 16:58 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Albert Aribaud, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Joe Hershberger, Jan Kiszka, U-Boot Mailing List, Peng Fan,
	Tom Warren, York Sun

On 8 January 2016 at 03:33, Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org> wrote:
> After boot_ramdisk_high(), ramdisk would be relocated to
> initrd_start & initrd_end, so use them instead of rd_start & rd_end.
>
> Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
>
> ---
>
> Changes in v2:
> Add comments.
>
>  arch/arm/lib/bootm.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

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

* [U-Boot] [PATCH v2 2/6] ARM: bootm: Try to use relocated ramdisk
@ 2016-01-11 16:58         ` Simon Glass
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Glass @ 2016-01-11 16:58 UTC (permalink / raw)
  To: u-boot

On 8 January 2016 at 03:33, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
> After boot_ramdisk_high(), ramdisk would be relocated to
> initrd_start & initrd_end, so use them instead of rd_start & rd_end.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
>
> ---
>
> Changes in v2:
> Add comments.
>
>  arch/arm/lib/bootm.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Acked-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH v2 6/6] rockchip: kylin: Check fastboot request
  2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
@ 2016-01-13  2:40         ` Jeffy Chen
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-13  2:40 UTC (permalink / raw)
  To: u-boot-0aAXYlwwYIKGBzrmiIFOJg
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	sjg-F7+t8E8rja9g9hUCZPvPmw, huang lin

Hi Simon,

Just know our guys are upstreaming our reboot mode support with our 
legacy reboot mode definitions(in our legacy loader & kernel):
https://lkml.org/lkml/2015/12/21/161

and that serial seems close to get accepted, so i think maybe i should 
use that definitions too...

On 2016-1-8 18:33, Jeffy Chen wrote:
> We will save boot mode flag in grf's os_reg[0], if fastboot
> requested or fastboot key pressed, try to enter fastboot mode
> at preboot stage.
>
> Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Acked-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>
> Changes in v2: None
>
>   board/kylin/kylin_rk3036/kylin_rk3036.c | 32 ++++++++++++++++++++++++++++++++
>   include/configs/kylin_rk3036.h          |  3 +++
>   2 files changed, 35 insertions(+)
>
> diff --git a/board/kylin/kylin_rk3036/kylin_rk3036.c b/board/kylin/kylin_rk3036/kylin_rk3036.c
> index 40d6b52..df2c123 100644
> --- a/board/kylin/kylin_rk3036/kylin_rk3036.c
> +++ b/board/kylin/kylin_rk3036/kylin_rk3036.c
> @@ -8,10 +8,15 @@
>   #include <dm.h>
>   #include <asm/io.h>
>   #include <asm/arch/uart.h>
> +#include <asm/arch-rockchip/grf_rk3036.h>
>   #include <asm/arch/sdram_rk3036.h>
> +#include <asm/gpio.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> +#define GRF_BASE	0x20008000
> +static struct rk3036_grf * const grf = (void *)GRF_BASE;
> +
>   void get_ddr_config(struct rk3036_ddr_config *config)
>   {
>   	/* K4B4G1646Q config */
> @@ -28,6 +33,33 @@ void get_ddr_config(struct rk3036_ddr_config *config)
>   	config->bw = 1;
>   }
>   
> +#define FASTBOOT_KEY_GPIO 93
> +#define ROCKCHIP_BOOT_MODE_NORMAL	0
> +#define ROCKCHIP_BOOT_MODE_FASTBOOT	1
> +
> +int fastboot_key_pressed(void)
> +{
> +	gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key");
> +	gpio_direction_input(FASTBOOT_KEY_GPIO);
> +	return !gpio_get_value(FASTBOOT_KEY_GPIO);
> +}
> +
> +int board_late_init(void)
> +{
> +	int boot_mode = readl(&grf->os_reg[0]);
> +
> +	/* Clear boot mode */
> +	writel(ROCKCHIP_BOOT_MODE_NORMAL, &grf->os_reg[0]);
> +
> +	if (boot_mode == ROCKCHIP_BOOT_MODE_FASTBOOT ||
> +	    fastboot_key_pressed()) {
> +		printf("enter fastboot!\n");
> +		setenv("preboot", "setenv preboot; fastboot usb0");
> +	}
> +
> +	return 0;
> +}
> +
>   int board_init(void)
>   {
>   	return 0;
> diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
> index 49997ec..424e81b 100644
> --- a/include/configs/kylin_rk3036.h
> +++ b/include/configs/kylin_rk3036.h
> @@ -39,6 +39,9 @@
>   	"mmcpart=5\0" \
>   	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
>   
> +#define CONFIG_BOARD_LATE_INIT
> +#define CONFIG_PREBOOT
> +
>   #define CONFIG_ANDROID_BOOT_IMAGE
>   #define CONFIG_SYS_BOOT_RAMDISK_HIGH
>   #define CONFIG_SYS_HUSH_PARSER

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

* [U-Boot] [PATCH v2 6/6] rockchip: kylin: Check fastboot request
@ 2016-01-13  2:40         ` Jeffy Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Jeffy Chen @ 2016-01-13  2:40 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Just know our guys are upstreaming our reboot mode support with our 
legacy reboot mode definitions(in our legacy loader & kernel):
https://lkml.org/lkml/2015/12/21/161

and that serial seems close to get accepted, so i think maybe i should 
use that definitions too...

On 2016-1-8 18:33, Jeffy Chen wrote:
> We will save boot mode flag in grf's os_reg[0], if fastboot
> requested or fastboot key pressed, try to enter fastboot mode
> at preboot stage.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2: None
>
>   board/kylin/kylin_rk3036/kylin_rk3036.c | 32 ++++++++++++++++++++++++++++++++
>   include/configs/kylin_rk3036.h          |  3 +++
>   2 files changed, 35 insertions(+)
>
> diff --git a/board/kylin/kylin_rk3036/kylin_rk3036.c b/board/kylin/kylin_rk3036/kylin_rk3036.c
> index 40d6b52..df2c123 100644
> --- a/board/kylin/kylin_rk3036/kylin_rk3036.c
> +++ b/board/kylin/kylin_rk3036/kylin_rk3036.c
> @@ -8,10 +8,15 @@
>   #include <dm.h>
>   #include <asm/io.h>
>   #include <asm/arch/uart.h>
> +#include <asm/arch-rockchip/grf_rk3036.h>
>   #include <asm/arch/sdram_rk3036.h>
> +#include <asm/gpio.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> +#define GRF_BASE	0x20008000
> +static struct rk3036_grf * const grf = (void *)GRF_BASE;
> +
>   void get_ddr_config(struct rk3036_ddr_config *config)
>   {
>   	/* K4B4G1646Q config */
> @@ -28,6 +33,33 @@ void get_ddr_config(struct rk3036_ddr_config *config)
>   	config->bw = 1;
>   }
>   
> +#define FASTBOOT_KEY_GPIO 93
> +#define ROCKCHIP_BOOT_MODE_NORMAL	0
> +#define ROCKCHIP_BOOT_MODE_FASTBOOT	1
> +
> +int fastboot_key_pressed(void)
> +{
> +	gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key");
> +	gpio_direction_input(FASTBOOT_KEY_GPIO);
> +	return !gpio_get_value(FASTBOOT_KEY_GPIO);
> +}
> +
> +int board_late_init(void)
> +{
> +	int boot_mode = readl(&grf->os_reg[0]);
> +
> +	/* Clear boot mode */
> +	writel(ROCKCHIP_BOOT_MODE_NORMAL, &grf->os_reg[0]);
> +
> +	if (boot_mode == ROCKCHIP_BOOT_MODE_FASTBOOT ||
> +	    fastboot_key_pressed()) {
> +		printf("enter fastboot!\n");
> +		setenv("preboot", "setenv preboot; fastboot usb0");
> +	}
> +
> +	return 0;
> +}
> +
>   int board_init(void)
>   {
>   	return 0;
> diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
> index 49997ec..424e81b 100644
> --- a/include/configs/kylin_rk3036.h
> +++ b/include/configs/kylin_rk3036.h
> @@ -39,6 +39,9 @@
>   	"mmcpart=5\0" \
>   	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
>   
> +#define CONFIG_BOARD_LATE_INIT
> +#define CONFIG_PREBOOT
> +
>   #define CONFIG_ANDROID_BOOT_IMAGE
>   #define CONFIG_SYS_BOOT_RAMDISK_HIGH
>   #define CONFIG_SYS_HUSH_PARSER

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

end of thread, other threads:[~2016-01-13  2:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08 10:33 [PATCH v2 0/6] rockchip: kylin: Boot with android boot image Jeffy Chen
2016-01-08 10:33 ` [U-Boot] " Jeffy Chen
     [not found] ` <1452249212-25183-1-git-send-email-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-08 10:33   ` [PATCH v2 1/6] common/image-fdt.c: Make boot_get_fdt() perform a check for Android images Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
2016-01-08 10:33   ` [PATCH v2 2/6] ARM: bootm: Try to use relocated ramdisk Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
     [not found]     ` <1452249212-25183-3-git-send-email-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-11 16:58       ` Simon Glass
2016-01-11 16:58         ` [U-Boot] " Simon Glass
2016-01-08 10:33   ` [PATCH v2 3/6] rockchip: rk3036: Bind GPIO banks Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
2016-01-08 10:33   ` [PATCH v2 4/6] rockchip: kylin: Add default gpt partition table Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
2016-01-08 10:33   ` [PATCH v2 5/6] rockchip: kylin: Enable boot with android boot image Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
2016-01-08 10:33   ` [PATCH v2 6/6] rockchip: kylin: Check fastboot request Jeffy Chen
2016-01-08 10:33     ` [U-Boot] " Jeffy Chen
     [not found]     ` <1452249212-25183-7-git-send-email-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-13  2:40       ` Jeffy Chen
2016-01-13  2:40         ` [U-Boot] " Jeffy Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.