> Date: Fri, 10 Jul 2015 17:44:12 +0300
> From: fathi.boudra@linaro.org
> To: leif.lindholm@linaro.org
> CC: linaro-uefi@lists.linaro.org
> Subject: Re: [Linaro-uefi] how to port grub2 on ARM UEFI
>
> On 9 July 2015 at 12:51, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > On Thu, Jul 09, 2015 at 11:06:47AM +0200, Ard Biesheuvel wrote:
> >> > Now UEFI could boot both debian and android on hikey platform. And I'm
> >> > investigating to port grub2 onto hikey platform.
> >> >
> >> > Do you have any guide on this?
> >>
> >> I don't think GRUB2 requires any porting at the moment, as long as you
> >> grab the distro version, not the upstream source.
> >
> > Upstream works fine, unless you need the UEFI Secure Boot support the
> > distros use.
>
> For the record, I had GRUB from Debian Jessie working just fine on HiKey.
> I've got grub menu and it boots without issues.
>
> There's still something odd... I set a timeout of 3s in grub config
> and it takes closer to 10s in reality.
>

Actually it's 30 seconds if you set a timeout of 3s in grub config on hikey. I don't
know whether there's the same issue on other ARM platforms.

After debugging, I found the root cause. Now all ARM platforms set 10ms as timer
periods. In grub, it tries to set 1 ms timer notifier. So here's the conflict. Timer
notify will only be triggered when timer interrupt occurs. Even grub hope a timer
event after 1ms, UEFI will provide the event notification after 10ms. The only way
is to fix gEmbeddedTokenSpaceGuid.PcdTimerPeriod in UEFI.

I fix it in hikey UEFI now.

Fathi,
Please test it on your platform.

Regards
Haojian