From patchwork Tue May 12 11:20:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1182 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5BF663F1DD for ; Tue, 12 May 2020 13:20:54 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id j21sf10427338pgh.12 for ; Tue, 12 May 2020 04:20:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589282452; cv=pass; d=google.com; s=arc-20160816; b=neLtVcdqBgPh1vtoPHZWqDNxkiLT+ZuWj74hwbjlWRc0HDzV3GwNgDxKTGOQKDRe0x IFiggHpTww9ezbmPNGKFEGrACQZgSkENWW1AwXhyGMCDPOR+ZWQQ+0DOpw/jl4vgtiuy UwsCIQXMZvSZArzyH2Jd8C7ewsBMKopvHASpK1xdQNfq9lPs13zilhQB7X/Vyv5PLTGj pYw/W6Mgx3dLbt4ZlvfJ3vwXBpCSDmi6p4gWInnp/tWYH2O9VJkg5IxUS00QZs4ecA5p hneyEDBLed7Hlc2av/kjsKdeI17nreveo5gfHV44j7S4/zrfi85mYztx1t0dnXrmhU8K xCLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=Q1xpWKSj09w9yj05KqSTtTQ6jRSMCco2dvtNwPw1FJc=; b=NAwHw9GiVxLbd6CrusDQ26SWjrVkBBKdX7PXWtBoT7WsKHPgHip24UTo9vYxtcQSPE TIkAqPXHUPj6y1OPYqx4408EWFaa8t52Vj3tAs4xoaaEf7iikn6/lGAMvvtKbsvhlHfI bWCbtpkQNRA6WUCHdmQaVOiEqkErrcLNey5uFPMhS2KmcEdkAUwVnBFj+5oASnqSF7lV nlUz/EsjnDtfUoXPah6H1FXMX8dQJd4DNrzMP7Z771mm4FMCtMGHKNzGlH5bv7n0izKr G38cuzO2iRu6OGWwDS/VLKJNjbUAQ6OFevf+9uvmhvdXl9zH9xD8q+omgz6StFxOdg3o u/YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nkeinydB; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Q1xpWKSj09w9yj05KqSTtTQ6jRSMCco2dvtNwPw1FJc=; b=UYUXH9q4G0E9TmcpAfGhAQTt8tWgUtCxtR67K7Oy3/uilfZ/mSacZO7QuX3i7ymWVC BlIyrWwtLRkasgqSwM26+y0NBye7Fht52gGRjBXJ1BI6hdiD5h7Zdvscmu7Yo2SdQSVB q31jB+HD9jh7cFvpy+qZ9LUIBzUzsA8kt5x48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=Q1xpWKSj09w9yj05KqSTtTQ6jRSMCco2dvtNwPw1FJc=; b=sz4z39giUd1kjSPF6YPYsv6j+mY+rdp1cBdqI2pOzY1mjXJpsc6oLvv8tGU2cGSuKm nzKa2cnWwZ9JRvkTiyKptYMx6HhhJIk2gKuZ35DbF8F5EL6i2IyIn9c8JLoby2lpmdUT Ec0I8aW9sXREGZI5aetYxH7fK1Kq1XbXm9TrY+sKuJ1ar1z1GZ7Yv6s2BLN/Q1sQ2PE4 sXdQdqKFY0KCzKUwBk0dOhWlioyu6Tlx0yayvplCWgJrfroz7VDkKdpKS37Ih1rciNRg 1IhX84OYvcQOzu0ZWDkZXyD7s9dyVCUJ+uQlviHyrqMHS3OOqKkRwkZgs8t+tMyb8Qez xY+w== X-Gm-Message-State: AGi0PuYNI5Y8BEfp6VuhZDzwvfl1RDTQLgWcJt2JiyEjzttMwLpJbe/K uu06djFR8ggBjtXCHWstcIHC7Tss X-Google-Smtp-Source: APiQypKbSlo8bhWVHgkgsK5fKWxYipkVcS3TDbbY9tLTUHzjpnP6r6yoY3k3p2BkDKhGWqMD9qkE4A== X-Received: by 2002:a05:6a00:c8:: with SMTP id e8mr20453411pfj.206.1589282452072; Tue, 12 May 2020 04:20:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:1557:: with SMTP id 84ls799094pfv.3.gmail; Tue, 12 May 2020 04:20:51 -0700 (PDT) X-Received: by 2002:a63:6b81:: with SMTP id g123mr17857879pgc.1.1589282451572; Tue, 12 May 2020 04:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589282451; cv=none; d=google.com; s=arc-20160816; b=wTObKIxIPmU3WROeZRU/RivkvIRUOE+1XyJsmRv7zlYfhGSw2mrhEg2GSQ3WF3r3um bhrqT2aego8R9A0b4u5fqoaqP7Zo8lpiqoSd3KH+q56qVDUSSpszwmbJzCxtN6c5nJtg g+2zOJDvNALzwXCn4aVO+06EUgLv0jxv6/pyIoUkyNa5XYyLnejSWmQOxTjr/qtGHOLa xScUthdBQhDDRkUX5A3BdkhmgwnzkZm31sD8ftbJRN2v2WsqfC4RP87t6jhgEYPTCs7f mtxCL3JtTxhZEX3IauNXAF9MSaVUtk4AwbjxmRqiVbdYm/JRSA6MKthORe6xe+rOuUBD FCEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ix8EfgSkRl04DakEOtDmUXZIMMeV7MLAfmviBJ4RYDc=; b=BaglWUHjyUSf0FEmaj9TvVpf6W9h0aWaTMtrmf7CMLGelXBjKSfF9Fu+XNGeiI+vAk ZGkrzXGBhqJqsnCLKIWRsNVFxsbq3sK9hgPtN2MY3gJPhC+sViJSZ4bU0EopAHTz0uJR Uo8rzvUihZsLngxtqcFhoXs69TeBt/pY6BA+BltugMxzGUG1vOJDRiJ1Win+Rs9XwJgZ JBx1SS8G3jJ18m73sJOEcejRA+nRUOcfRM5aWSlf1/5zWmB0thlCyNBmh3iF2v/j//+/ bDKa/KybIczr1K46MeOF5eCwvlJU/9e+ELO1LSIYatLUj/CtB3jA7kX/wbv6FzLky1D9 TvMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nkeinydB; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z19sor19438768pjq.5.2020.05.12.04.20.51 for (Google Transport Security); Tue, 12 May 2020 04:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:9295:: with SMTP id n21mr26981875pjo.195.1589282450030; Tue, 12 May 2020 04:20:50 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id s199sm12042306pfs.124.2020.05.12.04.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 04:20:49 -0700 (PDT) From: Jagan Teki To: linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH 3/4] spl: Try to get boot device from board_get_int Date: Tue, 12 May 2020 16:50:40 +0530 Message-Id: <20200512112040.4140-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nkeinydB; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Jagan Teki --- common/spl/spl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index b0f0e1557b..cdb4b0b4cb 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -483,9 +484,20 @@ int spl_init(void) #define BOOT_DEVICE_NONE 0xdeadbeef #endif +__weak u32 spl_boot_device(void) +{ + return 0; +} + __weak void board_boot_order(u32 *spl_boot_list) { - spl_boot_list[0] = spl_boot_device(); + struct udevice *board; + + if (!board_get(&board)) + board_get_int(board, BOARD_SPL_BOOT_DEVICE, + (int *)&spl_boot_list[0]); + else + spl_boot_list[0] = spl_boot_device(); } static struct spl_image_loader *spl_ll_find_loader(uint boot_device)