public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Implementing spl_start_uboot() for directly booting linux
Date: Wed, 30 Jul 2014 10:26:59 +0200	[thread overview]
Message-ID: <53D8AC53.3020209@denx.de> (raw)
In-Reply-To: <CAAH1pR3PH5HeJUG_icqwRC_mezC4QxGjXkVuALtUh2ax7P_RUQ@mail.gmail.com>

Hi Abdul,

On 30/07/2014 10:21, Heshsham Abdul Basit wrote:
> Hello,
> 
> I am trying to directly boot the kernel i.e without u-boot, on my
> Xilinx Zynq based microzed board.
> 
> 
> I understand that for that I must implement the function
> spl_start_uboot() in spl.c
> 
> 
> 
> Right now the definition is:
> 
> 
> 
> #ifdef CONFIG_SPL_OS_BOOT
> int spl_start_uboot(void)
> {
> /* boot linux */
> return 0;
> }
> #endif
> 
> 
> Given here:
> https://github.com/Xilinx/u-boot-xlnx/blob/2a0536fa48db1fc5332e3cd33b846d0da0c8bc1e/arch/arm/cpu/armv7/zynq/spl.c

Anyway, you are not using mainline. Please stick with the sources on
u-boot mainline to get help here.

> Can someone explain how to implement this function for directly
> booting the kernel?  Actually till now all the boards I have searched
> have not implemented this function,

This means you have not deeply searched. Check for example
board/technexion/twister/twister.c:


int spl_start_uboot(void)
{
        int val = 0;
        if (!gpio_request(SPL_OS_BOOT_KEY, "U-Boot key")) {
                gpio_direction_input(SPL_OS_BOOT_KEY);
                val = gpio_get_value(SPL_OS_BOOT_KEY);
                gpio_free(SPL_OS_BOOT_KEY);
        }
        return val;
}

On this board, the decision which image to boot is taken by looking at a
GPIO (switch on the board). Of course, you can implement the way you
need based on your hardware.

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2014-07-30  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  8:21 [U-Boot] Implementing spl_start_uboot() for directly booting linux Heshsham Abdul Basit
2014-07-30  8:26 ` Stefano Babic [this message]
2014-07-30  9:37   ` Heshsham Abdul Basit

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=53D8AC53.3020209@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox