From patchwork Tue May 19 19:23:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1212 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0EA043F086 for ; Tue, 19 May 2020 21:24:30 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id a69sf747506pje.0 for ; Tue, 19 May 2020 12:24:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916268; cv=pass; d=google.com; s=arc-20160816; b=ziHuJJGbou0273GmQ3qTg92WAuTBU0D5SZ+MvL9496Kj1e+JXtT7Cu1ePBbMfvOyqf a0j8pmdXEzmYr3+09SEBXUmOWsOPdFLWIWVQBEC990PodkndvAyUqUQAmFEVJAV7oF8J 9XKNpSGCsknKw4YMzqeICPmFKb0FtajBFZxKHy4PDAVzRjHcv4QUyoe2CGjMp2Pin1+q VaWPS/mAfaQUm+6tgCIdoC8yVJZOd02+CKNAsuNwKiDfFMYYl86L75cnseZh/Fqpk42b g3l4U6s1U/pyWF5oZL0JLNLjeCw0vEs6F4GBRUW5ZXCnpKrSSzZZgTEFZnEb1Md3IaT6 yjSA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ty5Kt23hfphwHQ0iauCYsFInkYsQT7ZaYYE9gyM5jqM=; b=q1A7VC65B47L/pN/muyEw0UnjWasosAk818DvuavXyAmEYqD0IF14ULiUJdhp30X1/ NdFKM0Z1q28W/mgf2RVQyvzD2/22PyHjID7L0AxihQmyDSsulwwDSgoPG7pRoFDfkurL Yoio07aDJkjLFCHFa9qkUbxPAuUCZ/tEypXX6/RFzXpkByfR6zmQGwQn8s3Xn7qutee6 fGVwuoA1GehXDeo7E0K8W7VhEgGSCV75hpRrrsWuBs4911AdTJiiUB3Qkx5uubtpOR94 6Ww9ebzpRBsZN0piTep+N5uIN+tAtD1Uj6k0x2El973DdNjQAoL0xjBeWpkH2prnDRq+ 0q3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cvm8jLjP; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Ty5Kt23hfphwHQ0iauCYsFInkYsQT7ZaYYE9gyM5jqM=; b=faSiNHV3+C+25H57HQOucE53ZRqv6tBBKSwoN/rR+y8N8lGjLlPBZaIVHpC7Mot/TQ MlivSwDLh8rx22/jyUkvy0bdxxCipBdFX+9jUuvm27CcUoD6CTUxYITc+p11xZB+5ycm RIebs9a5H6TqtgC1ef8r7bipkIjvMXwOAPwZA= 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:in-reply-to :references: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=Ty5Kt23hfphwHQ0iauCYsFInkYsQT7ZaYYE9gyM5jqM=; b=rH9J1aO4dEJkErDmcMkTNMiRJhFPd1gIJ/UEE+kNA/8jBmOf1kxjvcTn40U90YYGyo QBobuE6wWLO8EeLo/DsceLt/DEzHh1wd0fegmSdpjVrhMGhOGb0OUv2BnZs7GcarOIYJ MxIfvvOjD38Oj4RMym9ivsYcM0axCKLbk+2PvXZVY8Jx379Hb9zUkOGiFOqd2VzzPs86 faVhVbTY2ts9boXXL8bGfRsJlpaivveADyuQOfUXHGMEnXZ58D+ZCG84m6TwUNCJz7bf qA2oJjjmOvzvP/N73dLzfOtp2eZU8IM6icZN12b2J3rnMWjeL+Sn9pDYbZ9fqx3t47iN X4gw== X-Gm-Message-State: AOAM533gwjkRtXt/8E6ubANng+XmVT0q5YtUI4Vc02Q1giZFCqOBYTSf HJXn5Zm78QBzg1IahHSEwSboH9Ak X-Google-Smtp-Source: ABdhPJx9kTJgVOpSDjR8u9N/0VEIxKz9pomHqDCH8WX8UIAuGNAT06iBVkoiDOy7CVAbJmtXiahkzQ== X-Received: by 2002:a17:90a:aa8d:: with SMTP id l13mr1212673pjq.92.1589916268685; Tue, 19 May 2020 12:24:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:12c:: with SMTP id 41ls101876plb.2.gmail; Tue, 19 May 2020 12:24:28 -0700 (PDT) X-Received: by 2002:a17:90b:344d:: with SMTP id lj13mr1192795pjb.160.1589916268232; Tue, 19 May 2020 12:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916268; cv=none; d=google.com; s=arc-20160816; b=gbHTlpnkL0cFu0fT/1u+gellcgY6Qy0hLK98Z7LK28HHUlNRXsauteQbJ8DJgzIc6w +W1a71aoCb5Q2yINoRC8KeHe3l3B+N7LmhQrBBC7yyq4ijSVltw3ka/Oi6Rxij664OR3 1cedvQhX8L0YYGo6TybDiivTh/EcAQxjRcSA3owIvBdw+rRQ4QgaSX/AG0/TDZbLtVTV 4LYGoYalHcJIgFmLPM2RFLHUOaU6ivizZapKpZXwMWQ11LS8r73f3XtU/lzZrw6705uE qVoo0l6eO2Vtuh516io9mfrtMreNGvgzVpR6qFZMAY44GhAeboIWOsZ8A3o7vgBDOL9B C+kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ug5Mn9JNdBHG8t5caMWjKTyxBhHTQ22TxGk0ePPcLl4=; b=rNSvlcsMHx+gxB3+9V5tAh+sLznVLeezl41giUe6cUvzkk+SJVXfaJHu0C9/Cer9La K3SugLT1Q0Jexd9lf+JVQA2skK4EqwiQsWmQRNg2KmzD1qGJYHzojjAViRBK/cJa0oQo WB4evrDqYqpbj5KHhgPMynsYbLc9ZpUuU6xram2gozgBemEVlxzvymTjpeFOYQ6TIN5I paYMsh7rStWADoVauA1i4881X3TrmNuuBXuY+VIlRRc+zJa8j1iEZMSXKoHDz+rb7/Ts XeXQo4WgciWwz+ryytb6OR31F51nGhsQFFjZkuJECQQ1YsUPISi3a5VVXdnueQMdARDz Z5Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cvm8jLjP; 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 z3sor410399plo.47.2020.05.19.12.24.28 for (Google Transport Security); Tue, 19 May 2020 12:24:28 -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:902:fe06:: with SMTP id g6mr973149plj.118.1589916267718; Tue, 19 May 2020 12:24:27 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:26 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Mario Six , Tom Rini , Simon Glass , Jean-Jacques Hiblot Subject: [PATCH v2 1/9] spl: Try to get SPL boot device via board_get_int Date: Wed, 20 May 2020 00:53:32 +0530 Message-Id: <20200519192340.16624-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=cvm8jLjP; 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: , Usually, the associated board would supply spl boot device using spl_boot_device() but some boards have board driver that are possible to supply boot device via board_get_int with BOARD_SPL_BOOT_DEVICE id. This patch add support for those. Cc: Mario Six Cc: Tom Rini Cc: Simon Glass Cc: Jean-Jacques Hiblot Signed-off-by: Jagan Teki --- Changes for v2: - new patch common/spl/spl.c | 14 +++++++++++++- include/board.h | 9 +++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index fc5cbbbeba..a07b71b3c1 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) diff --git a/include/board.h b/include/board.h index 678b652b0a..ce4eaba38d 100644 --- a/include/board.h +++ b/include/board.h @@ -211,3 +211,12 @@ static inline int board_get_fit_loadable(struct udevice *dev, int index, } #endif + +/** + * Common board unique identifier + * + * @BOARD_SPL_BOOT_DEVICE: id to get SPL boot device. + */ +enum common_ids { + BOARD_SPL_BOOT_DEVICE, +}; From patchwork Tue May 19 19:23:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1213 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AF4773F086 for ; Tue, 19 May 2020 21:24:34 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id r3sf715258pjq.7 for ; Tue, 19 May 2020 12:24:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916273; cv=pass; d=google.com; s=arc-20160816; b=1HRdOaIH7DOgva38gPQgVu5akRGF3kM2F4B4S3TfO1vSgiqclKTezl+2JPwRDXhYD8 ioAmrEz2Jsl7X6nekaIpmvvIWKw2Fcs4/oDd0+3YMFkgEuTgTOLc/U44mXItBS5kK6aD MaMzZJ/n7FiihVHYh6mupXsXnLvEp732KBWN6w6d3GOIG3swwisWcnNIU8l3bZVNNTlA 3/WXUMOHwiSzFVCtuRvJwAhKc9Dp436AjOutYLkkaGu1RWa6BVyNxncKQ5dU7G1xN7mI 3Xye/A/xX20dnc0wTXOIQ+t60/wxe6BlZVtNc1WDTcLuWHt+KgkofJWjmFrIAc2zoaOc 0BCg== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=eOGbSTsLe23fn3C9x9SUOqhdqcw39k+QeKjYncx6C4E=; b=HIg0OZzyWN8gq4IcZyKAf5TLObl/l+bb+KctNIS5pa/nnyTzzaXFUfuE9yjX/mf+tD cqBTfuk/HJkycdzYjj+wbVng5A/TYM96uS7TUVhT1mlyDm5MZz18qicfT12MJgKnFhve l0GOOSwdLsHJaq82YmwtxV9a4/VUqWHA7E//a3r11+W7g/XKlQfF+dSqN0syKIaNxMc/ kmiuaUV0kcwv54EXMXgUVszemom47k6tECqYrYtqrILDZJ8ry3/uagaPeMBrdyluL9FL g/gPaBkCR6eFzlADoxuEdCzm9a7D/ltzVTJ5pJhi0+6NwXfZsrxzJTV49w6JSu1xH/9Q NHBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oyjqWhGw; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=eOGbSTsLe23fn3C9x9SUOqhdqcw39k+QeKjYncx6C4E=; b=Nc5sPkX+9btwhFPjiOE1tn8FWbs0UHQKmlq7P3oochwunDWr3/pV/4Y64K0Rr0XGVh j0N1UI5hZAl3e143m0Sv6jMuFqGbsG3jdBq+HmOpRDund8udEwzVbrgUPT/aibTLF7W4 uDpmdPYuwopIr6MtHQCD6o/Mdk/qtxi+8y3hE= 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:in-reply-to :references: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=eOGbSTsLe23fn3C9x9SUOqhdqcw39k+QeKjYncx6C4E=; b=EWjIvE2X2LglQeXm3dIT/9wYHK7IZb9j5J79PhOdcf1sa6ijdlMOquCXjySgTo4DKP cdndZohSZ7k05ECVz3qPMc6ducTGF6421cBU5i30NtfsBxmDaFtLMWvpAoDEWplJVzSn Lh1eteMrP9eXwWU8p9kY9Ztn/67L/SQ/IRYUYiuC8aJb0CyQ83H+KU4mOHOyZb6wq86b jdyZjnFpdUFu1SQj/e7VRdBS7vOKZXogYKXX6G0znsa+v2Sq7TBAc+zwamPHI2EvF9/f vQ3pV86aiWDE7bieaK4NYye8witZspYAkKReNQezrTEZOjnEJtKjWda9+BTWqnXMWa8c pw/w== X-Gm-Message-State: AOAM530S3S0kQ0boUmXZRIF1IQZGe8Ue85PgtBji67WOxWng2SqYRAd2 7y6TfeCx2L4PdQGVJSIIdt7sNrhB X-Google-Smtp-Source: ABdhPJxdn/dRpv+0QLZvoi5l55PPNgCHmVMcGwSQNmlA/iXKzrvMxmPE7dh480IaboQbkgS5oeq4Ag== X-Received: by 2002:a17:90a:7787:: with SMTP id v7mr1133172pjk.199.1589916273466; Tue, 19 May 2020 12:24:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8d95:: with SMTP id v21ls99529plo.3.gmail; Tue, 19 May 2020 12:24:33 -0700 (PDT) X-Received: by 2002:a17:902:c40c:: with SMTP id k12mr940936plk.11.1589916272959; Tue, 19 May 2020 12:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916272; cv=none; d=google.com; s=arc-20160816; b=raXTUK3eGfq57Tlf2wod74e/GKflhENy0R2/saErW7y/m9h4f6OCUNZKhOuLJmH3hd 0LEYgFqkKB5Xl/C2QS5AuDzAxQsXlTNcP5XYW6VixhamfdbQCdga5tlwCrtUjIbKMaAE HoNNZyhBgqcDCY7/TQ5FcCevDNbJdKrMzUAziqxakp92MFokaPNZr7ZYuNL2sJVE+Q3T L7cu7PkzeYJGegOsfPgiWlLTR3YdzyWbAx7Kr8LkRhYFYQgOcS9/PGPG8DbIEy9rw/Pq UIf1xhTPIWXfKyADsy/WQNZlmp3bINHv25GbVg7GGoOihOAt81di5A7qLDSxfIaShpE/ n5fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=sHyfWYVdSf0sDAPyFHIINfBPsPCytqWb7we7stjjx/g=; b=Qlczv9QL0AX9FQPvcTVxHY3Wqh+P2NuIaTOA/7ggmBRYAc++SdIYBQiXvvzTuEFsjz 7rb+t4Ugki0AQAXbpENnDYIDnJ1vFArJunbqM7oE/67L02kgB363Lk1jiaZTi1aoRioR r5rBX023YTqpNdmopM8D6P1v7t+Cy1AXPcR0vG4u73umPJ0WcC8kY2cqMIz7QFDU6PPD 5Ptnqp3CEB4GuQKMlBrZOpdfgOuhFsHjqGEeDjXsqyWotqwk3poSrOmD4djkRWMNC8uM T0d3oaZFVFptUqAxhuh7yOTMDYXMWMa2gKAkztRksQHJZt3msqfJiWrlmoZ4wZLwRe33 JCWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oyjqWhGw; 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 k22sor969714pgh.54.2020.05.19.12.24.32 for (Google Transport Security); Tue, 19 May 2020 12:24:32 -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:a63:de06:: with SMTP id f6mr748914pgg.238.1589916272500; Tue, 19 May 2020 12:24:32 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:31 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Simon Glass Subject: [PATCH v2 2/9] dt-bindings: board: Document sifive, fu540-modeselect Date: Wed, 20 May 2020 00:53:33 +0530 Message-Id: <20200519192340.16624-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=oyjqWhGw; 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: , Add dt-bindings documentation for sifive,fu540-modeselect board driver, which usually get runtime boot mode of fu540 boards. Cc: Simon Glass Signed-off-by: Jagan Teki --- Changes for v2: - new patch .../board/sifive,fu540-modeselect.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/device-tree-bindings/board/sifive,fu540-modeselect.txt diff --git a/doc/device-tree-bindings/board/sifive,fu540-modeselect.txt b/doc/device-tree-bindings/board/sifive,fu540-modeselect.txt new file mode 100644 index 0000000000..801c068390 --- /dev/null +++ b/doc/device-tree-bindings/board/sifive,fu540-modeselect.txt @@ -0,0 +1,15 @@ +fu540 board driver + +This driver provides capabilities to get the current boot device for +fu540 associated board. + +Required properties: +- compatible: should be "sifive,fu540-modeselect" +- reg: physical base address and size of fu540 modeselct + +Example: + +board: mode@1000 { + compatible = "sifive,fu540-modeselect"; + reg = <0x0 0x1000 0x0 0x1FFF>; +}; From patchwork Tue May 19 19:23:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1214 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D09BC3F086 for ; Tue, 19 May 2020 21:24:38 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id z2sf426684pfz.13 for ; Tue, 19 May 2020 12:24:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916277; cv=pass; d=google.com; s=arc-20160816; b=IwyUyPmTVNJwJeY6vtvRgK37GHcTf+uZn/OJoww1/vcN42QVLZTMjE+QKx28IB67IY AtwP38EciXaAHZZoE5njy2fkDiMuarQmWrKu9g94ViKBk561j6vZQHK4Mihs0HlS2wrE LPZ08xXhdsM1jf2eYWVItsxsrfPNHhxDdmxtJwKFtoIh2jFdARxuT64PS2NCNjlL21qn Hfh+HsgYkzaAPD+lptmMY22r5dNhqOPW9QKJOp1MXLI/W9wisRu1EJ9CiGAPBtyLzV5t Y0nc/EcwveRXM9hsOf3TDphWafT2V7ObRsJXJIkprZMBfW8WacNYokHI6X60D6yss17H Y3ig== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=6U/kS3aODiZDf1gpkkqIzPXQqKLQStCMPf/2/qylWNY=; b=qDb8LPuVXmvRHUYmU5rt8MNPKNxK/SzMo/ouvXqxhbErduyTvafBEF1iGRQT734Lp9 lJgcY5MSwvVtYvgzMy+c6/fL0zDTa4EwAnK/MNjZGNu8CgFyfE0YIc8a6No6nsGw3nci tmH+Cq8B2EAobjNIbI//FXeVHbtBHKIWKXJnHwG5nMkwqTx6V9alO9VCjrFJsIHkWJUW n8870gtL2ogMSt1ehBKGK9DNrS818QRnjZ1uW8wX8xIVx8JrWZRARc5oTXyh26kPS24q cS5IuTE3sdxIekmRca3Q/5z53U5nQCS/ZVkmYAkBHkHAmj2tMUXXhKBDXXbnYXooZLU9 7Oyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AnuMOFdw; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=6U/kS3aODiZDf1gpkkqIzPXQqKLQStCMPf/2/qylWNY=; b=RU3YQ6EJHNKDYjNGt733SbXqR5om9d3r3yn0c9RcqOiX/epUKOen6SEX8YoiBY27oA Qu/zjG8n9idlqkvB9khyyFOpLSxH/5RYO/1lacAju04TOMsjKYsSf7YOsB/78zuYJQmI YbRAckDHQ7kt7aebAix37Mvx29fll5QcD1omE= 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:in-reply-to :references: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=6U/kS3aODiZDf1gpkkqIzPXQqKLQStCMPf/2/qylWNY=; b=T4VmiYj9HwsSEgGsiChjc8vy5lGjGYXucXTfr4u0p2PMhBZ9UZ9o0a75MyC4s76iVv kuwG6PCn1/wY/UD6RjJ4o8uJ6Uzty8xeFMkVxIuDSfed/KQcKeGHP7xXPh8GiGevt6qP TISpLBUc+OOJMKhgK2OWh7M3kTXdDLUy+VED7vbRV5EcACexwTx8qWsBUcoKKBgyuuCP hzg3rM57pDeBnBmAH55NLzAw9vveJBK2vdd7UjIU5gX2CVUoVJv7bZ4wqIV0yfK24n0r 6VnM4jx7Lrvienz6rHqvgWUznpA9p7IX79AttMSKyEB5ggjjKAx9WipT/2fQLig6qeX4 uyeQ== X-Gm-Message-State: AOAM53010BoG8rRdXVEeg4wrM0dAG4MDWRX4xWfHeKy2dr2SzCKxoQ+Q 38Ro3XdUR/WIWjR1FG2547DiaA6U X-Google-Smtp-Source: ABdhPJw+FV10bxJfXhEusTHYSeUMc+8pCEczoUx7IZ/NyslFLewxgoccAmIR7kmnS12QJ6I2x1qxxg== X-Received: by 2002:a17:90a:5895:: with SMTP id j21mr1151906pji.92.1589916277057; Tue, 19 May 2020 12:24:37 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b702:: with SMTP id d2ls94600pls.6.gmail; Tue, 19 May 2020 12:24:36 -0700 (PDT) X-Received: by 2002:a17:90a:4495:: with SMTP id t21mr1076201pjg.185.1589916276586; Tue, 19 May 2020 12:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916276; cv=none; d=google.com; s=arc-20160816; b=X3I0CNlwkv5Yr/We8kPAHQlvpLVqJXVYXq/9shAOpludXf9nisC5ZYt3uEn7KLvnfr +hJ37OVo1ovnSl/d/LHPM07yc8/Fe0bWl1MI5acQxZepR2CP4oQHN4FNFX/frNjljNu5 DabBA0k8Y+fU7Qq+zT5kNTqFoTCnHk2D08vRKNuL3nA+IAnm9US8u1UIKQZcqzbcaBZF tV4vXjomBDSwWIxle8S/uIaYZUCeXQP0KxFYC424G6stab/DhX4HLXrQ0D3zRgBLBn9O 8jzfxgf6yb8/YoeTrKZxvP3hEt+sJruS4Mym8HI1dDS3YxcsTG1Ed2JXAiJn6SIDWh6z VcLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wQRnrCcKBaUZ5qrH7kStrqLRK78MH5/+WJ8rfYLkS4E=; b=lzuIcXkuUtbEnqquvX+w1Ner5JXwH0shUO0IHEIPBpBuc0T5OM2UFhIlVa6bM4EGjd 7vCIZ/vEiRmLtzYPkHOpzlKQCvuSaKFAObaWwDNom0y5PnAwlSKnG4e7uOwiBWWAdDwp WmG0/BtB+5oMSg/rFwRwx0AmQwIzBpgTXE+SfLyZw1dxms2EPk9sXcvzxgx48ir0KcUY EAhv/sYyzhKKni2LgYrBR4jEi9AIgH7P6G3AEcxIDNndlXlFUf22KwqaqusfuVzo0k5u IKk0dB5pjblVhRY8lV7O5sA5LeotkeARKd2CWt2A1ry0jEaUfFOtZbU7T9SRqr3PwJZj 28hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AnuMOFdw; 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 66sor417083pfa.0.2020.05.19.12.24.36 for (Google Transport Security); Tue, 19 May 2020 12:24:36 -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:a63:b0f:: with SMTP id 15mr702692pgl.6.1589916276314; Tue, 19 May 2020 12:24:36 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:35 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 3/9] riscv: dts: fu540-c000-u-boot: Add sifive, fu540-modeselect Date: Wed, 20 May 2020 00:53:34 +0530 Message-Id: <20200519192340.16624-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=AnuMOFdw; 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: , Add sifive,fu540-modeselect node, which usually get runtime boot mode of fu540 boards. Signed-off-by: Jagan Teki --- Changes for v2: - new patch arch/riscv/dts/fu540-c000-u-boot.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/dts/fu540-c000-u-boot.dtsi b/arch/riscv/dts/fu540-c000-u-boot.dtsi index fc91a7c987..0ccda0e59b 100644 --- a/arch/riscv/dts/fu540-c000-u-boot.dtsi +++ b/arch/riscv/dts/fu540-c000-u-boot.dtsi @@ -48,6 +48,13 @@ soc { u-boot,dm-spl; + + board: mode@1000 { + compatible = "sifive,fu540-modeselect"; + reg = <0x0 0x1000 0x0 0x1FFF>; + u-boot,dm-spl; + }; + otp: otp@10070000 { compatible = "sifive,fu540-c000-otp"; reg = <0x0 0x10070000 0x0 0x0FFF>; From patchwork Tue May 19 19:23:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1215 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 539133F086 for ; Tue, 19 May 2020 21:24:43 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id l25sf534626pgn.8 for ; Tue, 19 May 2020 12:24:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916282; cv=pass; d=google.com; s=arc-20160816; b=S/rkebbx2h9zO8NX14+LQ60jR1NlAnV61xhAXm64dGkAAkdorbSSAEchRVxgKb/23f 2Pvh2qakbjHvpvbri4TWiBxNAB4IDQpvQApow/m/QFd9a1vkCZOjv3tkRBFNQDUEgYzr F/VdXm5k5MIK8viwLUlxaBKXKG70wGT8hcju0etFuxZJBVyI1izZNvnxhYZhD+7/P21C V9lhC30JXj2dNlt7a60PbCVNVi0pjbTOzqGLe7VZ1uNfNGB0LXEjRIK/e0gHm4rCIkCC xbd8cwycARXyHWntW31QRU+XwfEq0a3Zdcj4RcDV89qwvXie7UJhekswbagswv5F8lao K/Ng== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nLe7zeTeSb7IrKlod5/V2rx/FIGiQ44IBUmS0v0KiuA=; b=z7EmBPVojFvLrGE9cJolYuk4dmU8Ii/U3U6wBwb7VRKEFiT9H+4sSiGuc+deAQbwII wX3vvPN8o4898z84VRpLBHY7sx41z/NSKKVk5YP++pQi/Mk9Nf42xE/GOdvsO1n3Uoaa k/ACUF3vp8XnbgtF0K09I5R/8WRFcFHihW2sevXz5U17q7rWET4ixM09UUqu6Jpsba3o ZOOl/X5RaTHuy6uLzHPgknCLbpycPRFrMWPwLHSojO8cCPLWkP69y6H9PycGq1/xYET1 wBcJUNNHIrmmW+5YbNdUPBf13fXb/cOp/W62LsZgFtGEJ1umJUstEtjQ9E5cH6ybGIlH /S2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Kqjk1duo; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=nLe7zeTeSb7IrKlod5/V2rx/FIGiQ44IBUmS0v0KiuA=; b=qFQh7SvZ/8OVOQpbGcNxb5w63902upA44+WIB7+ywRDH2QXg4M+deYB51mwrkK46WU 81vWeR7yaTCEi76gK62AMXQ0jwyPdVhe1AnPqJje+zrYtYN/u0/pCMb5Oe5dpWyzc/pw /EyIOhaQngwzrfaXXYA5LcYF7I81X6ak18yL4= 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:in-reply-to :references: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=nLe7zeTeSb7IrKlod5/V2rx/FIGiQ44IBUmS0v0KiuA=; b=BRRk37mBSXqyprBvqBuD2V1bzAUOwX5lSNlHvtu7wF6jEKoWAiBuv6a3r5sA781JYl o9vvSyTRUZawqvTAKLNNTYLV1b7ufvaoBww4OVWvxCyzVNTIlL/wJqhmaUfVZRfDibO9 AnncA8maJf+rd5cJ/WL7M4cCXKH4kruATqwIxq4+7UPX/FJgRpooza0zOGXTeuQZkYLT WpXR0Oe8Ymdw57ZP9LX4lWHJYEzmIZELZrFxIBugl2UeR4P6WvtHzRFi3u0tjHSJSbB+ xcyylNMmML9SmPDdp4ULbb628mjuzUrRA1aI3m76VV9tybm6JWiOywo8k5EzHwma8OCC L5xA== X-Gm-Message-State: AOAM532Pj3m20Jwe0ovhTCTs4chXIw1bJI0sGaONtEfbBAdRC+SYbdJ9 ZDEKj24ZGZ1KlmctC4V9sPujJcMG X-Google-Smtp-Source: ABdhPJw8AcLtzZtcyv7sC5E7fWn643e5yuAcxv7Bu80ibI8jeYZzuvlTOCz49sZFee5TdUh1TMRdmg== X-Received: by 2002:a17:90a:9f95:: with SMTP id o21mr1102825pjp.91.1589916281897; Tue, 19 May 2020 12:24:41 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:191c:: with SMTP id z28ls153313pgl.11.gmail; Tue, 19 May 2020 12:24:41 -0700 (PDT) X-Received: by 2002:a05:6a00:46:: with SMTP id i6mr665950pfk.146.1589916281360; Tue, 19 May 2020 12:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916281; cv=none; d=google.com; s=arc-20160816; b=MkYYJFKlvxkJy2ndAvsAovffKASUjpoauNXWrHXkYA4eTNXPY1tx5IFX6QwWIZfUvy nx/n+eImQJCqLPDN5S2ihAd9slMFA+OJP84uzAkIAyyDM6PyG7E5sjOda3XE2B4OhAOv FHL6kOxmcqHqyRHm5Zo56vksiohDNaNYOmZMd1LyShgDuTigisVgrHaxPTuOS8alL8V8 5U6Wn9Qt7c0yNQ9ruGQ5ED9vNgNqMQqSIwAm3+m8IkEZLPGWYwHn5FRQWUgvjZ6YyfD4 tAzJ1DObOu930YndMGFQpUGTAQpxunfu96eKFDmNq8kYAJWJu9w3HLCZ/RpUgl60s19I SkNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=m6tHTWPu33s92LiU+iJcaJyzN2BnUnszfQVO3bujTUk=; b=jxkQZCHpFt5PPksSFC4A2+wteKQrgTcgRJ6v0lxwdrTuSolXQsAV8RBLsNI+yNOcl/ HXJBk3E1++OQ51IIr9cYPaCQ7BHeohl5GOKYTXBIg8PJ7Bk0SyNSv9pX99fGhvhpMeDI C/ZxHgSAizVnaGdBfzZupmCzaUe0QBuK9tvRr4BC1DFKcDJIYf5/fpiUPXONR/7rhquz bml9Iv/S54+xlg5HKqiRbbgefN4eAtgETOuZURp3w4SupHainPdF2YxcKCq20yYmGHbr Uibv5/ElvjiXLd2zOliAyGChv5eyG0l3YaFWsWVgVZV4YO9NX7rLDEfT39TGHG/GtMSH lyIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Kqjk1duo; 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 c13sor379206plo.73.2020.05.19.12.24.41 for (Google Transport Security); Tue, 19 May 2020 12:24:41 -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:902:bc42:: with SMTP id t2mr954438plz.233.1589916281000; Tue, 19 May 2020 12:24:41 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:40 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Mario Six , Tom Rini , Simon Glass , Jean-Jacques Hiblot Subject: [PATCH v2 4/9] drivers: Add fu540 board driver Date: Wed, 20 May 2020 00:53:35 +0530 Message-Id: <20200519192340.16624-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=Kqjk1duo; 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: , Add fu540 board driver, which is used to get runtime boot mode of fu540 boards. Cc: Mario Six Cc: Tom Rini Cc: Simon Glass Cc: Jean-Jacques Hiblot Signed-off-by: Jagan Teki --- Changes for v2: - new patch drivers/board/Kconfig | 8 ++++ drivers/board/Makefile | 1 + drivers/board/fu540.c | 86 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 drivers/board/fu540.c diff --git a/drivers/board/Kconfig b/drivers/board/Kconfig index 254f657049..306ee76bbd 100644 --- a/drivers/board/Kconfig +++ b/drivers/board/Kconfig @@ -12,6 +12,14 @@ config SPL_BOARD depends on SPL_DM bool "Enable board driver support in SPL" +config BOARD_FU540 + bool "Enable board driver for the FU540 boards" + depends on RISCV + select SPL_BOARD + help + Support querying board information for the fu540 boards, like + get soc mode select, get SPL boot device and etc. + config BOARD_GAZERBEAM bool "Enable board driver for the Gazerbeam board" help diff --git a/drivers/board/Makefile b/drivers/board/Makefile index cc16361755..e924472779 100644 --- a/drivers/board/Makefile +++ b/drivers/board/Makefile @@ -3,5 +3,6 @@ # (C) Copyright 2017 # Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc obj-y += board-uclass.o +obj-$(CONFIG_BOARD_FU540) += fu540.o obj-$(CONFIG_BOARD_GAZERBEAM) += gazerbeam.o obj-$(CONFIG_BOARD_SANDBOX) += sandbox.o diff --git a/drivers/board/fu540.c b/drivers/board/fu540.c new file mode 100644 index 0000000000..68d356df6b --- /dev/null +++ b/drivers/board/fu540.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2020 Amarula Solutions(India) + */ + +#include +#include +#include +#include +#include +#include + +#define MODE_SELECT_QSPI 0x6 +#define MODE_SELECT_SD 0xb +#define MODE_SELECT_MASK GENMASK(3, 0) + +struct fu540_board { + void __iomem *regs; +}; + +static int fu540_get_boot_device(struct udevice *dev) +{ + struct fu540_board *priv = dev_get_priv(dev); + u8 boot_device = BOOT_DEVICE_MMC1; + u32 reg; + + reg = readl(priv->regs); + switch (reg & MODE_SELECT_MASK) { + case MODE_SELECT_QSPI: + boot_device = BOOT_DEVICE_SPI; + break; + case MODE_SELECT_SD: + boot_device = BOOT_DEVICE_MMC1; + break; + default: + dev_err(dev, + "Unsupported boot device 0x%x but trying MMC1\n", + boot_device); + break; + } + + return boot_device; +} + +static int fu540_board_get_int(struct udevice *dev, int id, int *val) +{ + switch (id) { + case BOARD_SPL_BOOT_DEVICE: + *val = fu540_get_boot_device(dev); + break; + default: + dev_err(dev, "%s: Integer value %d unknown\n", dev->name, id); + return -EINVAL; + } + + return 0; +} + +static const struct board_ops fu540_board_ops = { + .get_int = fu540_board_get_int, +}; + +static int fu540_board_probe(struct udevice *dev) +{ + struct fu540_board *priv = dev_get_priv(dev); + + priv->regs = (void __iomem *)dev_read_addr(dev); + if (IS_ERR(priv->regs)) + return PTR_ERR(priv->regs); + + return 0; +} + +static const struct udevice_id fu540_board_ids[] = { + { .compatible = "sifive,fu540-modeselect", }, + { /* sentinel */ } +}; + +U_BOOT_DRIVER(fu540_board) = { + .id = UCLASS_BOARD, + .name = "fu540_board", + .of_match = fu540_board_ids, + .ops = &fu540_board_ops, + .priv_auto_alloc_size = sizeof(struct fu540_board), + .probe = fu540_board_probe, +}; From patchwork Tue May 19 19:23:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1216 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 00CE03F086 for ; Tue, 19 May 2020 21:24:47 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id x132sf504573pgx.22 for ; Tue, 19 May 2020 12:24:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916285; cv=pass; d=google.com; s=arc-20160816; b=gzkoCTN7DIhJE4G164Um1MxSRfpxE8ISNaSZGyMOmsE47h9Hp1YOdUTFDwrxnWpMXS vcC2vFsGi2p2EJdL8DlOZRN5rekl7tjZMEhLSdVCFrEghe0NfXxENTZR2eRl/+9JDcHL XiGrC/y5/nZ40Y80XwTqXO8GdSifhl7gvZSp9rYviWo02LxSrFpeYWHC/faMiNa24yuf TSG6LRtecEaViKWOe5lStoGwanlpLBB3dBBjW/76ELRLvzf8fms1F/+MrQoBTYyfi1Ja 4+JY5qRuqWAMK2iem0HpIW18DU9ya/U0HQHxfVH8l5mK/KbEpyQa00J1Kw7d5njsZvPp Vy8A== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7r08axu5GCbDc9lklonFahDhNhKI/mnOKE0+GX7d1j8=; b=u7q6Et6rIrZCg7mhrmiz++lIZ2PQR9o89F1Xe0nGxMtP5yiL0+nDBVLjxaV5wYAVv9 PEFZomRVy3ogZB0hrwulpGWSv6VwAwj2CodUxIPk/8SjMCYK0SWuvj7PRUKg2XGv+GxG pvZ//An1B6L81SNAU5L32DxMmFTmg0iTXV4uA5UcB28aYwuli6VSQTWMrOgefuN35yOP 0jtN/ogusxQoz4Azy4ZFR6C1rnPVFNEjJdkMINC+/kbD49eANc/HlYLMt2Tq8mVIAdtn N+SjxVvUUYW1TDdLeA8syHHPgU0ubLEUYUHO3axLNgy5auo03wUL1/LYcBXv1j3tVPXb nAzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HTB14d5e; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7r08axu5GCbDc9lklonFahDhNhKI/mnOKE0+GX7d1j8=; b=Y8RyNaXOwA5bHAe4r7Ai2VNgH7kKNSqx/LMkZkI21cA98YRYdCKuMwqobdfZsoDpLL 0RJecNPzoyRidpLgOtLVY2TLoVm7o15GXSLlyBs12EHiHu4QpIWreYZKJMo2RDEMTXOY 6ZBiXcmODTjlS4NQcOwBeuuT6LQUv/X3skqPw= 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:in-reply-to :references: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=7r08axu5GCbDc9lklonFahDhNhKI/mnOKE0+GX7d1j8=; b=NR/dKLqaOWf2KAo+fO93/pJ+K1DXltRAmHtQSh5qV7PRe7n3jsmkfWx1PoLZY8wNhf TchJgQ2tQ0V30CYgf4POQsFn6jzOvFOW6gmL3kjgcj93hTooZq7bJjzLZGO0ntQ1iJDQ cADRr51EkIECV9/xXAoldKNOSFc+wqo1tdB9oWyo2wGIZLFtml4t/pg+cg+aujsITx1D qVrGQqyn8J6hMDTVdkYyP/ZGqHOyxS55bE3HtvPrz5r1A94UydXXYWD5RN+8e1g/g1fY AhS4u7/7pIoclwN3RyLMEJifoggptCuO/dt/Zj69reKue+NMZZlh1Zgk0EpsZtKAAqJD daFA== X-Gm-Message-State: AOAM532/9SUmlHPoiV5kIdsPD9f642jlNGcRLzYhP1JAwlH3ipXysLYh sJ+x6Ha2CP+JWbqEriBCL+PvD2id X-Google-Smtp-Source: ABdhPJzpVhwh5C/NLnU0nPZKH4H+qcJb7rLz+PFXzpt8V20kVfv4PLHr60KB1IX/Mzn8SdWXTaCFdQ== X-Received: by 2002:a62:168d:: with SMTP id 135mr558695pfw.239.1589916285740; Tue, 19 May 2020 12:24:45 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:e116:: with SMTP id z22ls156821pgh.9.gmail; Tue, 19 May 2020 12:24:45 -0700 (PDT) X-Received: by 2002:a63:f94f:: with SMTP id q15mr707685pgk.256.1589916285204; Tue, 19 May 2020 12:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916285; cv=none; d=google.com; s=arc-20160816; b=arUR5a7kcBaUd7B6fv1Qeq1ypc3fljy8wKtmXp+ZIVhLNKLOxliGOjmXnedcJFR2Mq Kl5Ms2+zmbw5tGSGGA+uNAHgiL3YPDbA1Xk6Xuvp3zC6AB6vPBeTWEkZz+7eOrMlj+oD XiGMPlYywo/LYl8J5ItBkJ+RXonEgSS/5Qi16zWk3NqKJX6Y9YzuwxVW77UndPo2oP6u PxtkGtQudvcf3kTun3pbPObxaB5I/STYB8zPMrbXMJBaCZ5zxCy2yd2W/iCefH4KeQEQ 0UQw2wfJr71zAfjVbjLQLhsVIe447kbQLYS3gjPcEwpKgpQy19FhPyn1YIVTlZKMvTzj l0Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=09Qf1T+fvlhBfVx1TLgBZwQYUWr10jqdqIDeq0OFCJI=; b=L5Rq0ygDd93wKsuinEjrsddGlTEuXFmXtFLmDfGdvTiALXSimCm+qeDusLojZnlql8 E7Ihuh95rorDyorbqYF2viBP5rd9OPDHAxsg2LxoIhHuZ33YD++7/YSqseGnJnw++2ez s0TE5KpXJwmGM8bA7RV4qdTFIL3kee50zlZoHVNZHWRZ3fgF3PYsJIspyX77boNA7b5m kXhXD7mETWLFHf2xdzLdxvMWWGHxFNCkHEqfh6qMH9XXAgC6E3s1BvjAgwzYYfezZEf1 Tdq0Tf9+/xLOzs1ui9qe7wY30dpjYb+BNsrvcfMTMysTC9Hl7IAeuGLa5ytwgkgoaCQe 4hpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HTB14d5e; 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 g19sor430040plg.16.2020.05.19.12.24.45 for (Google Transport Security); Tue, 19 May 2020 12:24:45 -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:902:8b82:: with SMTP id ay2mr973898plb.94.1589916284793; Tue, 19 May 2020 12:24:44 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:44 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 5/9] sifive: fu540: Add Booting from SPI Date: Wed, 20 May 2020 00:53:36 +0530 Message-Id: <20200519192340.16624-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=HTB14d5e; 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: , U-Boot SPL 2020.07-rc2-00156-gb9abb0716a-dirty (May 19 2020 - 21:56:17 +0530) Trying to boot from SPI U-Boot 2020.07-rc2-00156-gb9abb0716a-dirty (May 19 2020 - 21:56:17 +0530) CPU: rv64imafdc Model: SiFive HiFive Unleashed A00 DRAM: 8 GiB No reserved memory region found in source FDT MMC: spi@10050000:mmc@0: 0 In: serial@10010000 Out: serial@10010000 Err: serial@10010000 Net: eth0: ethernet@10090000 Hit any key to stop autoboot: 0 Signed-off-by: Jagan Teki --- Changes for v2: - enable board driver - comment spl-payloade-offset - reference for SPI partition arch/riscv/cpu/fu540/Kconfig | 2 + .../dts/hifive-unleashed-a00-u-boot.dtsi | 12 ++++++ board/sifive/fu540/fu540.c | 12 ------ configs/sifive_fu540_defconfig | 4 ++ doc/board/sifive/fu540.rst | 41 +++++++++++++++++++ 5 files changed, 59 insertions(+), 12 deletions(-) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index e9302e87c0..7a813a9ac8 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -5,6 +5,8 @@ config SIFIVE_FU540 bool select ARCH_EARLY_INIT_R + imply BOARD + imply BOARD_FU540 imply CPU imply CPU_RISCV imply RISCV_TIMER diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index 303806454b..4b2b242deb 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -12,6 +12,10 @@ spi2 = &qspi2; }; + config { + u-boot,spl-payload-offset = <0x105000>; /* loader2 @1044KB */ + }; + hfclk { u-boot,dm-spl; }; @@ -22,6 +26,14 @@ }; +&qspi0 { + u-boot,dm-spl; + + flash@0 { + u-boot,dm-spl; + }; +}; + &qspi2 { mmc@0 { u-boot,dm-spl; diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 535ab60aed..a7b530b281 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -116,18 +116,6 @@ int board_init(void) return 0; } -#ifdef CONFIG_SPL -u32 spl_boot_device(void) -{ -#ifdef CONFIG_SPL_MMC_SUPPORT - return BOOT_DEVICE_MMC1; -#else - puts("Unknown boot device\n"); - hang(); -#endif -} -#endif - #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig index 8d412f8d6a..551d4b04a5 100644 --- a/configs/sifive_fu540_defconfig +++ b/configs/sifive_fu540_defconfig @@ -2,9 +2,11 @@ CONFIG_RISCV=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x3000 CONFIG_ENV_SIZE=0x20000 +CONFIG_SPL_DM_SPI=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_TARGET_SIFIVE_FU540=y CONFIG_ARCH_RV64I=y @@ -15,9 +17,11 @@ CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_OF_BOARD_FIXUP=y CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_CLK=y CONFIG_DM_MTD=y diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst index 9e9ae98b64..d3d38eb966 100644 --- a/doc/board/sifive/fu540.rst +++ b/doc/board/sifive/fu540.rst @@ -541,3 +541,44 @@ Sample boot log from HiFive Unleashed board type: 0fc63daf-8483-4772-8e79-3d69d8477de4 type: linux guid: 9faa81b6-39b1-4418-af5e-89c48f29c20d + +Booting from SPI +---------------- + +Use Building steps from "Booting from MMC using U-Boot SPL" section. + +Partition the SPI in Linux via mtdblock. (Require to boot the board in +SD boot mode by enabling MTD block in Linux) + +Use prebuilt image from here [1], which support to partition the SPI flash. + +.. code-block:: none + + # sgdisk --clear \ + > --set-alignment=2 \ + > --new=1:40:2087 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \ + > --new=2:2088:10279 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \ + > --new=3:10536:65494 --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \ + > /dev/mtdblock0 + +Program the SPI (Require to boot the board in SD boot mode) + +Execute below steps on U-Boot proper, + +.. code-block:: none + + sf erase 0x5000 0x100000 + tftpboot $kernel_addr_r u-boot-spl.bin + sf write $kernel_addr_r 0x5000 $filesize + + sf erase 0x105000 0x100000 + tftpboot $kernel_addr_r u-boot.itb + sf write $kernel_addr_r 0x105000 $filesize + +Power off the board + +Change DIP switches MSEL[3:0] are set to 0110 + +Power up the board. + +[1] https://github.com/amarula/bsp-sifive From patchwork Tue May 19 19:23:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1217 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AA0503F086 for ; Tue, 19 May 2020 21:24:50 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id l7sf716731pjn.5 for ; Tue, 19 May 2020 12:24:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916289; cv=pass; d=google.com; s=arc-20160816; b=Swa6xc/aEGusHwvZSkyaIQDSigZZykm7Aje9B3YsHWYpdVA8ntYOdTC7LimFKuNsqX C2h4T2THtPeVwqW7tmkV8Nab7RS74rGjQlEOXLYwiCoNok6nKULSipXl/eHN9yImTBxY Q1cURBfJ04YLsDOPUiOxD++nYSNVdhnOdUojC6hNkW65WXssoK+Sa7jpoIZXx6JWoGLQ cw6l53dng84V2JOL49BNFbF3sxCb+DxZLUKvKLGsLvZ9B7Fehuoq3nA96IY4TjSVrXoS fXKYHEtiP+vnHbUZA9jn16o+DKU7gucZ0xEUZ92vAYEDjLz6kwxiigmx7wx8M1DtLcnd 5nTw== 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:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=bp2R37qZ/gXv40NHu+5jbVSCiO990xzKVL4eP5Eyqs2aquvpT6Zgl2CpLMv9mJiIYS 5CdMIz+/RE2QGkIutOkaksiPBOSjn8VylG5uG4ALYjUmeGRkC7+ACgm+XxnMnl6rWmkj Dx9XXtZc+6eS491gQ/JJka9STzHgXATmMTNfYPExwH+aYv0mDYmadZgmkN7ocK/wbCCI hVg3MvrJERQUSNUkawR+hv4c7XHC1msSvWiO7y7Jt8aI7vZaQKbkY3yenoHDhQacpFQW s9os8XlVIPQHdeY2PGz3Kb2MBtwstjrYutKQ6oVJQZsNH0jPdrOI9WG2GmKQM+PGWf7L anKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Pv1xQCbJ; 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:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=LhRFhqp/JkJEnPq3ktc5vnjkVLU6WsU/id3SYYImgmTcCHiSpvFYlJ2vaKYO1Pw3eN t2LXroPpPfNNIVNf/jdA4GowHMPzNuPa6tVSCccD3YMt8c5X0Fynrae1meMOtOeuol3A A+jF2DAhyVvgqSlbMPr+L7KXmR/FYMHQY1ZMM= 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:in-reply-to :references:mime-version:content-transfer-encoding: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=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=RDXKD0Qunf5rv0T9vEjaKK2/7rsOL4L4aoa3aht69Gzig1qB815GPBeQd8SWaVkeS6 gYGMzZ9N42yxwsw0i6gYHlfbrdAHDcrB11vhbXy1AuTbxnDt1yjqdS6RPh1+f+PXdxld UukhN9QoTo0CK9POF0vn5VTVQYMtxrO2lrGyLvJauxb1/FheSqyLXv5Oioq7nQ6zw9RS ndkgn6bU054U+IEk5ZlQmGwUDXA68pMHWVVfCNONya6akoonsTIbz00IBCXuq9XFIL70 aFcby6IUcCtE2A1taZRUsy7qWTD7paizs568QKJrgVGFr4ZXmRe80mH7HnlWJUGh3BVw BmRQ== X-Gm-Message-State: AOAM533Hu0eabrR5wC8iRvQyU2Zu5dzb+DSDws9HfSoEepjN2ovkizva vtB1XCeDNnZEaUEAzWYIGWQXtplY X-Google-Smtp-Source: ABdhPJySYTFjuW0nK2eYM1sclG3A+EgYSAXmawsCzj86Oh11H3rPkhx1JYWnOOyzUiftNYOfcWhgxw== X-Received: by 2002:a17:90a:c7d8:: with SMTP id gf24mr1099242pjb.218.1589916289505; Tue, 19 May 2020 12:24:49 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8f8f:: with SMTP id z15ls92725plo.8.gmail; Tue, 19 May 2020 12:24:49 -0700 (PDT) X-Received: by 2002:a17:90a:358c:: with SMTP id r12mr1032417pjb.161.1589916288997; Tue, 19 May 2020 12:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916288; cv=none; d=google.com; s=arc-20160816; b=KPc9otTKpnQTGwLPzwkp0hYIm1rGnvEaFSULw4i6RZvjMlDgn/jKMzAt7whAYXQ9a5 rJGDCAFd8gO7vYmNnhdUGndLnNaVw5FjrfjLTS5RhrMsQyYX/+H6j0ET374hBeH1nVXi mVd87MAjyXNMHy7gOnE/NCBhUqODVvD00H20kcGlG7NDIZt0YT/JANnJ+MStsiK8mQzm dFwjkMYj4dzQqh7D0B+FYs0/6RTX4FsRBza8h7bvdtcMasJtMwA247UrXalESLS2Ntg7 IP1a1U5d4yFaKNZ/jeJiOxzHB7BXBSqXGMStb6EifDzZkvQLfOHy4ZEr5IPDWvgvCssi 9vDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=QN1n4c5LMxVf1YaYQWpBH3NQf3Ufv/ksTgLkPGZFTCM=; b=wljG9KNxiPByjMPlAzL58QxkBYmFhSUsdm5sJ85Q21fn6WDFHt69jL4V9fT9fRjlOO ghXOplifWbStzu5DR0MEX6k3b5wNYAw5MlnAzs/wJnfZXiuCcWMAe5UOIX26/470uQpF D3w6uVQuIfau0WwWMWjI8SpJ+0V/ZgLLzDgjGHvXqmqIpYdDneuJyrJvYYHkF8zos05Z KXnxwRE4md9bH7NyMDp0q0qTlpViAq8nCkLDMi3AWCY2S3pyjcjZ/nw2hSpphhUJ1BE4 v8CnFFQnsP8z3zpdqeADalzYj15AnD4Z9REg8ER98PtN6ktE1yID7ZKnlYBd26NnZ1gF 89mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Pv1xQCbJ; 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 q7sor388797pli.66.2020.05.19.12.24.48 for (Google Transport Security); Tue, 19 May 2020 12:24:48 -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:902:7b86:: with SMTP id w6mr968557pll.292.1589916288629; Tue, 19 May 2020 12:24:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:47 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 6/9] env: Enable SPI flash env for SiFive FU540 Date: Wed, 20 May 2020 00:53:37 +0530 Message-Id: <20200519192340.16624-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Pv1xQCbJ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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: , SPI flash device on HiFive Unleashed has 32MiB Size. This patch add SPI flash environment after U-Boot proper partition with a size of 128KiB. SPI flash partition layout(32MiB): 0 - 34 : reserved for GPT header 35 - 39 : unused 40 - 2087 : loader1 (SPL, FSBL) 2088 - 10279 : loader2 (U-Boot proper, U-Boot) 10280 - 10535 : environment 10536 - 65494 : rootfs 65528 - 65536 : distro script Note: the loader1 must start from 40th sector even though there are 6 free sectors prior since 40th sector is nearest flash sector boundary.  Signed-off-by: Jagan Teki --- Changes for v2: - move env offsets from generic to cpu Kconfig arch/riscv/cpu/fu540/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index 7a813a9ac8..417926d2cf 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -15,3 +15,16 @@ config SIFIVE_FU540 imply SPL_CPU_SUPPORT imply SPL_OPENSBI imply SPL_LOAD_FIT + +if CONFIG_ENV_IS_IN_SPI_FLASH + +config ENV_OFFSET + default 0x505000 + +config ENV_SIZE + default 0x20000 + +config ENV_SECT_SIZE + default 0x10000 + +endif # CONFIG_ENV_IS_IN_SPI_FLASH From patchwork Tue May 19 19:23:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1218 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AE2DC3F086 for ; Tue, 19 May 2020 21:24:54 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id 207sf436500pfx.8 for ; Tue, 19 May 2020 12:24:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916293; cv=pass; d=google.com; s=arc-20160816; b=Yk/ew9TjNzrBLJqeTjVxJc9ypzowyEyjMxMtok+dZ/lM7J5mHOl/1qhumNh3aVSzRJ r/qTTAw7uo2xeNkmeBgaGbgMKrLd2AgCq2+HxiPAOIrqosULz1D7hj5Rnzhv3isWUGOg 4HHjvOQtGfzMCyl/1qcsLP59T0TgJpcM4JYLi4PJv05awi/qFZbrI9Geeu3NrYD998mZ 9XgPy6op0ng50X+zDC5BQg/ataw0rQoCxRGXY/fa6dVEcYkBX7eOWL5LcDbIpVxysfpK /AhJ1ovZ9n6Dz768py0y53fZrWB/ubZoRhRY7TOtt7p7n7aJoB7vMSAJrZDwl+BEB5r+ vXXA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=E+/Jes+NYln6ssnVxHViGpiZuhqh/EDor4TmOoA3/1Q=; b=JytCkLT3X1VHbKOF7cMCelSPTvFajGdS5bcXwO2uNpG7oiPBR08LhvfcRPABJzPkF7 hYlIrxi4Y/23xbA4jKnH8O//Re9WAWlxYQztw2xr4XgQNipeIx9dlVWdXALw6MPLzSzQ CKsO8P0LOlrkN6JeN3jdif5lTSV0c3o+JVGbeF0MfvV2JTAvK4AF+97OikZNTkqal2Jh F2GTe3zmIC/k26d4NYe40W9KMC3Huy1CtNVNScK+MsJUXpbUHWRBcuLhQNR012ca9kvB ZRFRbAfIajW+1vNtl36V5320YgWbgYAVgvm4mB9yprKLlBx3bNOOU3X8nRSfjtGSZXxj B9nA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="F0iF0/ol"; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=E+/Jes+NYln6ssnVxHViGpiZuhqh/EDor4TmOoA3/1Q=; b=rd51uM7xmmK89frHu0MWsn+DW+O89MRrJC7fHR8MYpGZsNEIzEYGiXVgF+KaBl9NrE nCqOqIC0XIn6oFZ+Zj78C81hrf+Vy5FVc+dWTCiqf073ROb8DebeJAPRlWq1e3w577f/ +6WR2IdHnSFdR2X+5G/+OF5P8vPCmCx2WhSic= 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:in-reply-to :references: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=E+/Jes+NYln6ssnVxHViGpiZuhqh/EDor4TmOoA3/1Q=; b=RWvSqF6ovy6ozZZMJw/xM0qr0/gMXpYrj/mgYLBP7rxWr8lDJE44Tfn+08Xqc8uR2h 2L8Wj9SFFr420JHea7iJUFyKtsNKsWLgz/6vSM0ub6yXxfj6dZQbCIo4mnq8CNUNUo9z bJBk/jepIzB7stetuvlCvJ+9KNVrSJe3JOJQ7PrjTccV6e0eFo6SQCffzg4Y23deJ0KH edikyS0DPLuoIrDt8Y/n7G5a69sWHKvBS4FnVxc9egGKFrV1KoEeFlTA5hfGXUevRqjY d0eAGOFkCiQMF3sN+bDNoLs0CsmgwczWNZzDKA0/8prfrUrHj6ev4JkhzYmzCbT8tN/F Hgtg== X-Gm-Message-State: AOAM5300F1xUnlqe8CyxQSipAZnq9LlbOgyeIKS/Nvs77f9tW9NOsiyw YP2S7Z160Xv8cq0sjr9gfdytWU2O X-Google-Smtp-Source: ABdhPJyy7D3wfpa1ZAKoEg6ZS513WKx0N9T+gqCImFPB7sk3TBJY+7Jp6tLXfN9OXcxG0Nl0t3o4OQ== X-Received: by 2002:a17:90a:db0c:: with SMTP id g12mr1087635pjv.5.1589916293518; Tue, 19 May 2020 12:24:53 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:1cca:: with SMTP id c193ls108489pfc.9.gmail; Tue, 19 May 2020 12:24:53 -0700 (PDT) X-Received: by 2002:a62:750e:: with SMTP id q14mr595588pfc.149.1589916292935; Tue, 19 May 2020 12:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916292; cv=none; d=google.com; s=arc-20160816; b=X5OPr9rfP9bbrNzqmKUn17wyiAqPMmDdoI3msP5IL0D9rxsyLpIIna639URHbQXgFb DTlbG/m7H2K5FUNKFm9qEoRSbjeIb27JNdFYMx7J8YGO4HnO9uN/7XrhVLEESbsvrfgP rfSa4tQHIZrqOIlhrvCODbMS5Zb/7WTkjubkuHupgsPV4eND3eAja+wQytyxkSPKg2i6 V5SQmvZb5u9fLims2VGmD3X/Mg9Gt3XFpBmreRhrPmrqaNxjpaYJjvWWlbb8oiDQ67mW D6gX3Ixkr5LvmXEMg1di0Gd3o1FTY6J6ITN+x5+PVF+j6GKrTvAWybXm8IcYgSMQahoE D07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wI652VJdyWuIcU29W3eIGaODun8gpyBhHddUGFzIduA=; b=fjoGwzNehBmRf6Bz+8fsrCEfhygTuLWNulRPAZAey8stccX7jTYwaXF5z0OREnt6vs Ord0DE7oIEX8rRyiPb87dQ5nGoYfxSKfEE7Wh46F4RCFqiQ99csukCDlT2+aqVq3mKRm J1MMP5RgyIcieY2GMhx+A2dFVtT3747VRBUdRFclVf1n7IAuo/dOUzDE1aJuuLFUqEdB i/2ZVEXtaWbWZHJR1+AVJ+LHH9+9tBTK25Juosdq0V2leZf6GAhGGc7rM/ZVYRe4+GGu 9XJv65ZWwmOjBKq/ATUniYKqdYFtrhiWkuOmpoQB3yD6wdbB4qFYwIBySFnMZvK1UwS4 jDUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="F0iF0/ol"; 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 w20sor354587pfc.84.2020.05.19.12.24.52 for (Google Transport Security); Tue, 19 May 2020 12:24:52 -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:aa7:93d2:: with SMTP id y18mr572727pff.181.1589916292630; Tue, 19 May 2020 12:24:52 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:51 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 7/9] sifive: fu540: Mark the default env as SPI flash Date: Wed, 20 May 2020 00:53:38 +0530 Message-Id: <20200519192340.16624-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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="F0iF0/ol"; 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: , Mark the default U-Boot environment as SPI flash since this is an on board flash device. Reviewed-by: Bin Meng Signed-off-by: Jagan Teki --- Changes for v2: - none board/sifive/fu540/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index 86193d7668..e1ba629e37 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -27,6 +27,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select SIFIVE_FU540 select SUPPORT_SPL + select ENV_IS_IN_SPI_FLASH select RAM select SPL_RAM if SPL imply CMD_DHCP From patchwork Tue May 19 19:23:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1219 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 831733F086 for ; Tue, 19 May 2020 21:24:58 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id m15sf523294pgl.15 for ; Tue, 19 May 2020 12:24:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916297; cv=pass; d=google.com; s=arc-20160816; b=oYPsbzelCebyHjoEsaFPPn/Ryh5p1jnNPkwzhiNGgmiBmdCGFzogHH03A2BhFG2vAj HUvrkC+bEaUUV0T9lWppzrynSlfaifrNSmBCzdlKeT8rE7ZSaJTd+nD4E4AT8k/rmRNy e1+FdbrFT9+sBEgiEShwVGpY515yTVSaaVkoQzELp4BUZvg3VfzEK3wscP12W97YVE+E tyfgOB0rjoD5gLWrPJE+Gh8kSqsL81pJkhV8NNKUahI5+qelUvFkFuPL35+d64d3ZgIp YBwkNCPxyGY9aedOwetj8w0ySynTx+esYKQYf8SgJGSkx6OplISxVtFElHFBJKY6jZAI jLeA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Zfx+XGfbmgKrBqSP5dYESDlBqKSx/9NIvl9odsaJYFo=; b=aQyqwGNmSRAKJxFJAQYJhO5iO3NoZa9TkfO+1TvwvzvLTZR3EiYoybOrsecFTnp4HR CSw/V7ZuLbrv5kp884I6N5csQv1KKmHzOQnSWAvKOMJbrK1M2snxxXdby1E/PJ5GuNX5 wm76OZBid7h1vSCe06OPfJZmpjWMpWt9PqFNPHy8zYITroNlrFmySCZGwvKXwSUWCmMK ZrqHW0zr6wxVnTYLmSa+8nsB7K2aUI56T5ZEmJ8C3RGw2E9kXUl1/mvwbxa6ON4UQmml /4lNhQtADta9h1/FxPjk4vN4CWYzQEwVqlmKH2rRWFpmpEvjSrubAMCnGEbk391a6Ozc 7Q5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TSmkE5US; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Zfx+XGfbmgKrBqSP5dYESDlBqKSx/9NIvl9odsaJYFo=; b=gKG/Yk1jPCbLQ3SQUzGQkBRoTaf+CLPyFlRAh452Vjf/qvOMTvVXkzx/J6CsHR8GNS Ny8dC7Amq6vytsYxRr0jZBono2/1jL4KZLEUC1zxeddEILLaj8b5ZgdsaXmTLCtoidpA JQZkGtykstrO234ARp+nc9ZiWX2tkdcXWJQYQ= 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:in-reply-to :references: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=Zfx+XGfbmgKrBqSP5dYESDlBqKSx/9NIvl9odsaJYFo=; b=kwckeyhgvHICnzK7jCowg0zQTqR8C1O4odYj67iMaMYfD9CvIHXhJztT19KO52Mmc4 3s98tvAKyxRmOptkDt/ofoFSa69R1ZBEYJNsiav3/QKb3pWPiBbu4C91AqQCry+Sk0PK CuAHiqUkP3fAs49lddwurG7zsDgl4mBPoPwG/dEzpE+ls2dSXu7iyB3cdto7NKjYt+0r 90zOJTHVCCmDfNEhOoIIfdJzQsY0V6w9mRUEIdtt9UsIR9cnSYR3IdQvMR9G1old6X/G L9zJIMSeA7ZZZMIfUvkgDtrM79yxQnHgrXOfjkzwWYkybxky2W0YD6JK663Sd0DQ2PiF wcdg== X-Gm-Message-State: AOAM533hLGjFQjuYg9w40R7q1bmlxgQwipWX8lPU+ldiVEZZOtpeiXuv N2bIHTtMUeuhi76bOGJ6Tr0kVnhb X-Google-Smtp-Source: ABdhPJxHI+2RBzboc8FaFm2KGpf9mIvhrJRt8/1ShBTSEepPXikNVpaBJFIZ2o6xyCvJaBWI3SFHrg== X-Received: by 2002:a62:dd03:: with SMTP id w3mr632385pff.76.1589916297340; Tue, 19 May 2020 12:24:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:12c:: with SMTP id 41ls102205plb.2.gmail; Tue, 19 May 2020 12:24:57 -0700 (PDT) X-Received: by 2002:a17:90a:ea84:: with SMTP id h4mr1170934pjz.8.1589916296900; Tue, 19 May 2020 12:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916296; cv=none; d=google.com; s=arc-20160816; b=A94ylXrvV+MpaPhTL0E3n8XtXB7gVOsjW8FmAwvEB9oPVzxzia39kP+e9F4DIakzWS B/uJVkin4+0SQ7o8ADIZCbcZq6E8ZkMZBaNWLHN1twI+0vEjyT3nmDMDkzWm6P0C6PaX jt9/YRLaZw1kU2MOKeMr3X5C4eNRC4uqnsspUudNNCBGNOfxPxLi010MvQXFlMcfJGhb acZ2ZpCELp+pnvK4Daww72TMge5yIooKn+LIvbxcv0cWcLzp7VJqPZcEyWxw5XVq+x9n dW1DW09SzJ2y8pCkl+ov3UzJ9TArNgjdRXGfhHPOY20zgqAPtPYDTwhFj/bcItGI4XMh FDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=E3cVPagWu9WBt6nhTDhaTTsD8dnBMhEElnF1hpAyA5Q=; b=Kd0JM57O/v8PaTLcyb6v+sS9LjgaRBH/CaWSV6cv/C5ncC7TfLcI3holfuAflBr/SS fo23wFhH5Os50yZ4fcNS/QMNEytKl5IeZH8lpWMRZy6bLvdhqZi5SuO8BoIqNjLVT7b4 mU/dC+naw7PCiVpNcTAt8ebBUozc7/6HK57D92RyZc4FBXDrBOeSJeW/UKg7bsGCgZ2D QshYD+rxHpj0rUn44HKpazd2AW+zakniGH8smyL32PCbkQfR5LLmXsuldW3JEOlt3q9E /FEGhA+0Lk6zbvqlwUXSv9vTLJfhLFQNzx+ZolT/DjIMmCi3r2W7rvltaSiqfOMJumrn HK4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TSmkE5US; 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 s12sor405907plq.51.2020.05.19.12.24.56 for (Google Transport Security); Tue, 19 May 2020 12:24:56 -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:902:7281:: with SMTP id d1mr1056659pll.78.1589916296553; Tue, 19 May 2020 12:24:56 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:55 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 8/9] sifive: fu540: Add boot flash script offset, size Date: Wed, 20 May 2020 00:53:39 +0530 Message-Id: <20200519192340.16624-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=TSmkE5US; 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: , HiFive-Unleashed-A00 has SPI flash with 32MiB size. So, let's use the script offset at the end of 4K. This way it cannot overlap any offsets being used by software components in flash layout. So, SF distrocmd will pick the script at desired script address and run. Signed-off-by: Jagan Teki --- Changes for v2: - none include/configs/sifive-fu540.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 72c841eb9b..68fda14d76 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -62,6 +62,8 @@ "kernel_addr_r=0x84000000\0" \ "fdt_addr_r=0x88000000\0" \ "scriptaddr=0x88100000\0" \ + "script_offset_f=0x1fff000\0" \ + "script_size_f=0x1000\0" \ "pxefile_addr_r=0x88200000\0" \ "ramdisk_addr_r=0x88300000\0" \ "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \ From patchwork Tue May 19 19:23: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: 1220 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 90D503F086 for ; Tue, 19 May 2020 21:25:02 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id u76sf555691pgc.1 for ; Tue, 19 May 2020 12:25:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916301; cv=pass; d=google.com; s=arc-20160816; b=Tx/dypyJWoVNqq3ElU9avMdYwc+XI9IFGOb5lo37K4meBTUoM6YZf25KfuJY4RXWeV 0AOo4D/jnQxHVUv8zSCKEpaEwbfETqc+CzceAuINZpuYpK9SJN5GBNEnZX0RQq5EEim8 +CI3Yotk3ld+S2KG1bVxAH4g4exwYa+RVAKR8tIbm3OB2j3DuH+Jnq4+wZRX/imneoPB +M+x7E6efZ9s3XE2iVu/NAi9iE3dxhyeSSsyxU0Zh6D20U6B/PB8mHSm5yxD87NU9k8Z Vvtt1ICmLqa/dV0wSOOf3Zl2AYnb6xLA6KjLCp18EIB6FFhELiNWBUIVukOd38R1bmjK bL5A== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=URJRr9ADa0OW/qkH6PzgXbNQL8vkBEWMOV0BAAKjmUQ=; b=CHXnXSsOZo1lCb5f5jU4hTpgBJrmpZuo61fSRcQrMy0opk8czoSWxRzz+9axOLRi8V 9BxNvS6izptO/4FVQE07aSJ8xDusTUBjYkGkM+Onz6N4H/GyHJ70IHu2jbot9UgPpljU qSWUxXDvFuntumV07DJIxpRav1sYuPtfhNgm4MMxXIG2lH0bjnm5ONLdjb8I98qL7ord sqw5otcSekQteugNb40yUz/irbYzDVQINNbJeupmNwhxJVX16uHuG7Zd/NMQKWcSMgyw Y0uCWHDfBjEnt/x+k/2NFG42b2FeBUBNZwQTTseI71ysa3yTQ7hDQHnpNOJMX0wQ28VG No3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rkvUNwhl; 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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=URJRr9ADa0OW/qkH6PzgXbNQL8vkBEWMOV0BAAKjmUQ=; b=jRMMobYaMfDuI/Vq/oM1GYUOQuePwl7jbkDKjF9YcSm7r0C0WrLbFiOkpzojvL6dFt 4gwCyNhC4wmhDpalt3QiPrzeT6sjJurJc8Q9++mSz2rDK9aNWM5qLytIt7Y0PznHSmoA EXG5K6T7a0cUKKojA2LFWeTREUHAVOCQCUdIM= 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:in-reply-to :references: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=URJRr9ADa0OW/qkH6PzgXbNQL8vkBEWMOV0BAAKjmUQ=; b=C74JSn6nFeOLPoeNFH314qx9u6uS1Fojp73LkhFkpbmUNZyunPRfjYyxU7Xs1hhtM+ OIbgDnKhwBD2pQHfDYGBtTwQ51oKRHnbdYn3hOMmsTBNCWhzRHXscaERXDurTCRrOLL0 tIJS7pKqS3d0uYP83Io/HbL93vWQ8xbtPBks4eIjNqBz0ETexUFlXpfJrjoRHsoDHymW G9o0RsSoh+lZdUadHwZG9VgU8/z12+eP4uqSEeG+lRkIzzklyJcYAyAOypUWg5RBdkxw LohCMe6tujfm9GVLj50BUFvu9zuGDASvYBZ11UoUyN3H0vLePp8fhwIq0mMgrz3f92N2 jy0w== X-Gm-Message-State: AOAM5328h5Zaiyok0wC5GilOlvRi0ey8AUdzCdr2aPhxPcPUvP3Ef/zp DCfwHpuo/8gTBbf0XMhXcfu0lxHO X-Google-Smtp-Source: ABdhPJwz3RnlMt8gV9AXGHgclWS8HgldRq2PTF5EYCskwONbzS917oh1cqjD2KNzQ9MX0BPyosfNSA== X-Received: by 2002:aa7:9ad9:: with SMTP id x25mr624850pfp.179.1589916301405; Tue, 19 May 2020 12:25:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:12c:: with SMTP id 41ls102247plb.2.gmail; Tue, 19 May 2020 12:25:01 -0700 (PDT) X-Received: by 2002:a17:90a:c284:: with SMTP id f4mr1182530pjt.68.1589916300884; Tue, 19 May 2020 12:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916300; cv=none; d=google.com; s=arc-20160816; b=cfhYAnB4dYHEHNzW1jiA34LUsxhN/CmI/otgzS2oDiP8W0Ji4XOzh91zb15lc3dXOs ZpV2Ux1w7AQgb6HVMSqwpMcT/i7JsUErZ7VRlDLUF8u6ytE4BESjmpH9cEqTQdFWYz39 +vhczDaFTioD84ws6OxoTQdNhOmr/GTsQzS/U+V1tJnGUE3OTludSOvwOm7FF+Jo0Zcx wKblF+6LNs++sHXBxA+TU2q/QQe7GmV/x67ejl0Qw7693EfARahlTS9/qicJfoN0KUqE olmeh5TrlbzZtBOoliArm0RNQkftbT7r60B0YlnrcqUup6+y8hixD8vaS/uBW3NmtUta 4+LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yNd1yFhWYcDllJiJJ9+yuaO19BfAZRDmvARM5Sau0n4=; b=hyEyzeAD58gy0EY77rI+JQ0TfZu5JFsMqZmrvQLEueLos/q2uXnt7kF9kHSPaB1n4J 741zUtAWm+5cFA9ZlxZ0SkU6YioJaHSJbOFRHG6jH1F214eB0dO49kjQ46+s+WDiNNKl oWM9Y2wFPDHLTFA+KC/rI/p3RLG8UGV5fld2/3HorsdddQUqXE6aswsRB9IiFI6zWfMv wVaAa088FZhlpsi5+B9HxxuwCsKAtxZGpSTkx/OdzwxcTaXVppsh5vS0bV2t1kmkceAA UGBHShz+ZnrcilpXaIaFn/T1X9nzfzGuOXDFwF5Av+joW08c68pdT6ggBvU+Yh78L8oK 68QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rkvUNwhl; 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 y16sor854823pjp.37.2020.05.19.12.25.00 for (Google Transport Security); Tue, 19 May 2020 12:25:00 -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:648c:: with SMTP id h12mr1113560pjj.229.1589916300538; Tue, 19 May 2020 12:25:00 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:59 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 9/9] sifive: fu540: Enable SF distro bootcmd Date: Wed, 20 May 2020 00:53:40 +0530 Message-Id: <20200519192340.16624-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-1-jagan@amarulasolutions.com> 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=rkvUNwhl; 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: , Enable SPI flash(SF) distro boot command in Sifive FU540. This distro boot will read the boot script at specific location at the flash and start sourcing the same. Included the SF device at the last of the target devices list since all the rest of the devices on the list have more possibility to boot the distribution due to the size of the SPI flash is concern. Signed-off-by: Jagan Teki --- Changes for v2: - none include/configs/sifive-fu540.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 68fda14d76..f21411a701 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -43,9 +43,11 @@ #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ + func(SF, sf, 0) \ func(DHCP, dhcp, na) #include +#include #define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47" #define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985" @@ -70,7 +72,8 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ - BOOTENV + BOOTENV \ + BOOTENV_SF #define CONFIG_PREBOOT \ "setenv fdt_addr ${fdtcontroladdr};" \