From: Przemyslaw Marczak <p.marczak@samsung.com>
To: "Krzysztof Kozłowski" <k.kozlowski.k@gmail.com>
Cc: "Kevin Hilman" <khilman@kernel.org>,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-kernel@lists.linaro.org, "Olof Johansson" <olof@lixom.net>,
"Mauro Ribeiro" <mauro.ribeiro@hardkernel.com>,
"Abhilash Kesavan" <a.kesavan@samsung.com>,
"Andrew Bresticker" <abrestic@chromium.org>,
"Doug Anderson" <dianders@chromium.org>,
"Nicolas Pitre" <nicolas.pitre@linaro.org>,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>,
"Kukjin Kim" <kgene@kernel.org>
Subject: Re: [RFC] ARM: exynos: MCPM: [is this a] fix for secondary boot on 5422?
Date: Mon, 15 Jun 2015 16:00:21 +0200 [thread overview]
Message-ID: <557EDA75.8060807@samsung.com> (raw)
In-Reply-To: <CAJKOXPfRgTf=6Z=pbz3zQj__Nt_uLtqhD65pYc3NMrF_NJ62=g@mail.gmail.com>
On 06/15/2015 02:17 PM, Krzysztof Kozłowski wrote:
> 2015-06-15 19:19 GMT+09:00 Przemyslaw Marczak <p.marczak@samsung.com>:
>> Hello Krzysztof,
>>
>>
>> On 06/14/2015 10:56 AM, Krzysztof Kozłowski wrote:
>>>
>>>
>>> Hi,
>>>
>>> +Cc Marek, Bartlomiej, Kukjin Kim,
>>>
>>>
>>> I would like to bring back this topic. Unfortunately I don't have
>>> access to source code of BL1 (or any other firmware blob) so my
>>> knowledge here comes mostly from experimenting and from looking at
>>> sources of vendor kernel for Gear 2 (Exynos3250) and SM-G900H (Galaxy
>>> S5, Exynos5422).
>>>
>>> It seems that some booting firmware (I would suspect BL1 because this
>>> ships Samsung to Hardkernel) uses SPARE2 as synchronization mechanism.
>>> For example vendor kernel, when booting little core, it waits till
>>> SPARE2==1 and then executes software reset for this core.
>>>
>>> Observations shown that BL1 for Odroid, when booting secondary little
>>> core:
>>> 1. Expects that SPARE2 register will be initialized to 1.
>>> 2. If it is, then it sets it to 0, proceeds further and little core boots.
>>> 3. If it is not, then it sets it to 1 and waits. Maybe this is a
>>> notification to userspace - reset me please!
>>>
>>> Unfortunately executing software reset in that time (at point 3)
>>> stopped kernel from booting. No logs/dmesg and I was unable to turn on
>>> early printk.
>>>
>>> The answer why two of little cores boot is quite simple now. At
>>> beginning the SPARE2==0 so first little core will set it to 1 and wait
>>> till software reset. Kernel timeouts on this CPU bring up so it starts
>>> the sequence for next little core. Now the SPARE2==1 so the core boots
>>> fine and SPARE2 is set to 0. The last little core starts from
>>> SPARE2==0, sets it to 1 and waits for software reset.
>>>
>>> Since no one knows how this exactly works and we are stuck with BL1
>>> provided as is, then IMHO the patch makes sense.
>>>
>>> Kevin, can you refresh the patch?
>>> It would be nice to:
>>> 1. set SPARE2 only for Odroid (of_machine_is_compatible()),
>>> 2. extend the explanation.
>>>
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>
>> I'm trying port the hardkernel's SPL to the mainline U-Boot at present. The
>> mainline SPL is implemented for E5420 and E5800. But there are few
>> differences:
>> - different DRAM
>> - different clocks
>> - different boot core (peach-pi boots from A15)
>> - bl2 signature
>> - hdk's SPL uses smc calls
>> ... and some more.
>>
>> The BL1 keeps signature key and some part of code, but it's code is
>> proprietary - but we should be able to setup the secondary cores in BL2.
>>
>> When, I get the basic setup working, then I'm going to focus on the
>> secondary CPU's init. I don't have the documentation for iROM code, so
>> everything takes a while.
>
> Great, good luck!
>
Thanks!
>>
>> If you looking for the lowlevel code, which is executed after wakeup,
>> please check this :
>> https://github.com/hardkernel/u-boot/blob/odroidxu3-v2012.07/board/samsung/smdk5422/lowlevel_init.S
>>
>> The 'lowlevel_init' label is always executed on boot.
>
> I already looked at it without any success. I couldn't find the reason
> of this SPARE2 behaviour in that code. However I found there one small
> funny fact about magic values for low power modes - kernel and u-boot
> expect some of the values in different places.
>
> Best regards,
> Krzysztof
>
I checked the SPARE registers, and only SPARE0 is set by iROM code to
0xFCBA0D10, it is defined in the kernel as: S5P_CHECK_AFTR. I didn't
analyzed the kernel code yet, however it looks, that it doesn't use
SPARE0 register.
I need finish the basic SPL support, and then will start synchronize
with the kernel.
Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak@samsung.com
WARNING: multiple messages have this Message-ID (diff)
From: p.marczak@samsung.com (Przemyslaw Marczak)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM: exynos: MCPM: [is this a] fix for secondary boot on 5422?
Date: Mon, 15 Jun 2015 16:00:21 +0200 [thread overview]
Message-ID: <557EDA75.8060807@samsung.com> (raw)
In-Reply-To: <CAJKOXPfRgTf=6Z=pbz3zQj__Nt_uLtqhD65pYc3NMrF_NJ62=g@mail.gmail.com>
On 06/15/2015 02:17 PM, Krzysztof Koz?owski wrote:
> 2015-06-15 19:19 GMT+09:00 Przemyslaw Marczak <p.marczak@samsung.com>:
>> Hello Krzysztof,
>>
>>
>> On 06/14/2015 10:56 AM, Krzysztof Koz?owski wrote:
>>>
>>>
>>> Hi,
>>>
>>> +Cc Marek, Bartlomiej, Kukjin Kim,
>>>
>>>
>>> I would like to bring back this topic. Unfortunately I don't have
>>> access to source code of BL1 (or any other firmware blob) so my
>>> knowledge here comes mostly from experimenting and from looking at
>>> sources of vendor kernel for Gear 2 (Exynos3250) and SM-G900H (Galaxy
>>> S5, Exynos5422).
>>>
>>> It seems that some booting firmware (I would suspect BL1 because this
>>> ships Samsung to Hardkernel) uses SPARE2 as synchronization mechanism.
>>> For example vendor kernel, when booting little core, it waits till
>>> SPARE2==1 and then executes software reset for this core.
>>>
>>> Observations shown that BL1 for Odroid, when booting secondary little
>>> core:
>>> 1. Expects that SPARE2 register will be initialized to 1.
>>> 2. If it is, then it sets it to 0, proceeds further and little core boots.
>>> 3. If it is not, then it sets it to 1 and waits. Maybe this is a
>>> notification to userspace - reset me please!
>>>
>>> Unfortunately executing software reset in that time (at point 3)
>>> stopped kernel from booting. No logs/dmesg and I was unable to turn on
>>> early printk.
>>>
>>> The answer why two of little cores boot is quite simple now. At
>>> beginning the SPARE2==0 so first little core will set it to 1 and wait
>>> till software reset. Kernel timeouts on this CPU bring up so it starts
>>> the sequence for next little core. Now the SPARE2==1 so the core boots
>>> fine and SPARE2 is set to 0. The last little core starts from
>>> SPARE2==0, sets it to 1 and waits for software reset.
>>>
>>> Since no one knows how this exactly works and we are stuck with BL1
>>> provided as is, then IMHO the patch makes sense.
>>>
>>> Kevin, can you refresh the patch?
>>> It would be nice to:
>>> 1. set SPARE2 only for Odroid (of_machine_is_compatible()),
>>> 2. extend the explanation.
>>>
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>
>> I'm trying port the hardkernel's SPL to the mainline U-Boot at present. The
>> mainline SPL is implemented for E5420 and E5800. But there are few
>> differences:
>> - different DRAM
>> - different clocks
>> - different boot core (peach-pi boots from A15)
>> - bl2 signature
>> - hdk's SPL uses smc calls
>> ... and some more.
>>
>> The BL1 keeps signature key and some part of code, but it's code is
>> proprietary - but we should be able to setup the secondary cores in BL2.
>>
>> When, I get the basic setup working, then I'm going to focus on the
>> secondary CPU's init. I don't have the documentation for iROM code, so
>> everything takes a while.
>
> Great, good luck!
>
Thanks!
>>
>> If you looking for the lowlevel code, which is executed after wakeup,
>> please check this :
>> https://github.com/hardkernel/u-boot/blob/odroidxu3-v2012.07/board/samsung/smdk5422/lowlevel_init.S
>>
>> The 'lowlevel_init' label is always executed on boot.
>
> I already looked at it without any success. I couldn't find the reason
> of this SPARE2 behaviour in that code. However I found there one small
> funny fact about magic values for low power modes - kernel and u-boot
> expect some of the values in different places.
>
> Best regards,
> Krzysztof
>
I checked the SPARE registers, and only SPARE0 is set by iROM code to
0xFCBA0D10, it is defined in the kernel as: S5P_CHECK_AFTR. I didn't
analyzed the kernel code yet, however it looks, that it doesn't use
SPARE0 register.
I need finish the basic SPL support, and then will start synchronize
with the kernel.
Best regards,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
next prev parent reply other threads:[~2015-06-15 14:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 6:21 [RFC] ARM: exynos: MCPM: [is this a] fix for secondary boot on 5422? Kevin Hilman
2014-11-25 6:21 ` Kevin Hilman
2014-11-26 9:35 ` Heesub Shin
2014-11-26 16:00 ` Kevin Hilman
2015-06-14 8:56 ` Krzysztof Kozłowski
2015-06-14 8:56 ` Krzysztof Kozłowski
2015-06-15 10:07 ` Bartlomiej Zolnierkiewicz
2015-06-15 10:07 ` Bartlomiej Zolnierkiewicz
2015-06-15 10:19 ` Przemyslaw Marczak
2015-06-15 10:19 ` Przemyslaw Marczak
2015-06-15 11:19 ` Amit Kucheria
2015-06-15 11:19 ` Amit Kucheria
2015-06-15 12:57 ` Przemyslaw Marczak
2015-06-15 12:57 ` Przemyslaw Marczak
2015-06-15 18:58 ` Kevin Hilman
2015-06-15 18:58 ` Kevin Hilman
2015-06-15 12:17 ` Krzysztof Kozłowski
2015-06-15 12:17 ` Krzysztof Kozłowski
2015-06-15 14:00 ` Przemyslaw Marczak [this message]
2015-06-15 14:00 ` Przemyslaw Marczak
2015-06-15 18:53 ` Kevin Hilman
2015-06-15 18:53 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=557EDA75.8060807@samsung.com \
--to=p.marczak@samsung.com \
--cc=a.kesavan@samsung.com \
--cc=abrestic@chromium.org \
--cc=b.zolnierkie@samsung.com \
--cc=dianders@chromium.org \
--cc=k.kozlowski.k@gmail.com \
--cc=kgene@kernel.org \
--cc=khilman@kernel.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mauro.ribeiro@hardkernel.com \
--cc=nicolas.pitre@linaro.org \
--cc=olof@lixom.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.