diff mbox

[v1,5/6] rockchip: kylin: Enable boot with android boot image

Message ID 1451893823-20309-6-git-send-email-jeffy.chen@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeffy Chen Jan. 4, 2016, 7:50 a.m. UTC
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>
---

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

Comments

Simon Glass Jan. 8, 2016, 3:34 a.m. UTC | #1
Hi Jeffy,

On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
> 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>
> ---
>
>  include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)

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

What kernel version are you using?

Regards,
Simon
Jeffy Chen Jan. 8, 2016, 10:51 a.m. UTC | #2
Hi Simon,

On 2016-1-8 11:34, Simon Glass wrote:
> Hi Jeffy,
>
> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>> 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>
>> ---
>>
>>   include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
> Acked-by: Simon Glass <sjg@chromium.org>
>
> What kernel version are you using?
It's kernel v4.1 for android project:
git fetch 
https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1 refs/changes/03/188603/5 
&& git checkout FETCH_HEAD :)
>
> Regards,
> Simon
>

On 2016-1-8 11:34, Simon Glass wrote:
> Hi Jeffy,
>
> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>> 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>
>> ---
>>
>>   include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
> Acked-by: Simon Glass <sjg@chromium.org>
>
> What kernel version are you using?
>
> Regards,
> Simon
>
Simon Glass Jan. 11, 2016, 4:58 p.m. UTC | #3
Hi Jeffy,

On 8 January 2016 at 03:51, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
> Hi Simon,
>
> On 2016-1-8 11:34, Simon Glass wrote:
>>
>> Hi Jeffy,
>>
>> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>>>
>>> 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>
>>> ---
>>>
>>>   include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>>   1 file changed, 23 insertions(+)
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>>
>> What kernel version are you using?
>
> It's kernel v4.1 for android project:
> git fetch
> https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1
> refs/changes/03/188603/5 && git checkout FETCH_HEAD :)

OK - just wondered why it needs ATAGs (CONFIG_SETUP_MEMORY_TAGS) - are
there things that device tree does not support?

>>
>>
>> Regards,
>> Simon
>>
>
> On 2016-1-8 11:34, Simon Glass wrote:
>>
>> Hi Jeffy,
>>
>> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>>>
>>> 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>
>>> ---
>>>
>>>   include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>>   1 file changed, 23 insertions(+)
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>>
>> What kernel version are you using?
>>
>> Regards,
>> Simon
>>
>

Regards,
Simon
Jeffy Chen Jan. 12, 2016, 2:36 a.m. UTC | #4
Hi Simon,

On 2016-1-12 0:58, Simon Glass wrote:
> Hi Jeffy,
>
> On 8 January 2016 at 03:51, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>> Hi Simon,
>>
>> On 2016-1-8 11:34, Simon Glass wrote:
>>> Hi Jeffy,
>>>
>>> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>>>> 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>
>>>> ---
>>>>
>>>>    include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>>>    1 file changed, 23 insertions(+)
>>> Acked-by: Simon Glass <sjg@chromium.org>
>>>
>>> What kernel version are you using?
>> It's kernel v4.1 for android project:
>> git fetch
>> https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1
>> refs/changes/03/188603/5 && git checkout FETCH_HEAD :)
> OK - just wondered why it needs ATAGs (CONFIG_SETUP_MEMORY_TAGS) - are
> there things that device tree does not support?
I saw our guys used to detect ddr params in the loader, and pass memory 
areas and reserved areas to kernel...
and kernel's device tree would only define a common memory node in the 
dtsi, which is not match the actually memory.
>   used to
>
>>>
>>> Regards,
>>> Simon
>>>
>> On 2016-1-8 11:34, Simon Glass wrote:
>>> Hi Jeffy,
>>>
>>> On 4 January 2016 at 00:50, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>>>> 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>
>>>> ---
>>>>
>>>>    include/configs/kylin_rk3036.h | 23 +++++++++++++++++++++++
>>>>    1 file changed, 23 insertions(+)
>>> Acked-by: Simon Glass <sjg@chromium.org>
>>>
>>> What kernel version are you using?
>>>
>>> Regards,
>>> Simon
>>>
> Regards,
> Simon
>
diff mbox

Patch

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