From patchwork Thu Sep 28 15:42:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 819662 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3y2zYC4VXXz9t3v for ; Fri, 29 Sep 2017 01:45:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5ADD7C21E11; Thu, 28 Sep 2017 15:44:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAD_ENC_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3EFB4C21DCE; Thu, 28 Sep 2017 15:42:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 786F1C21D82; Thu, 28 Sep 2017 15:42:43 +0000 (UTC) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0083.outbound.protection.outlook.com [104.47.32.83]) by lists.denx.de (Postfix) with ESMTPS id 86428C21D82 for ; Thu, 28 Sep 2017 15:42:42 +0000 (UTC) Received: from MWHPR03CA0018.namprd03.prod.outlook.com (10.175.133.156) by CY4PR03MB2695.namprd03.prod.outlook.com (10.173.43.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 15:42:41 +0000 Received: from BL2FFO11FD043.protection.gbl (2a01:111:f400:7c09::155) by MWHPR03CA0018.outlook.office365.com (2603:10b6:300:117::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Thu, 28 Sep 2017 15:42:40 +0000 Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD043.mail.protection.outlook.com (10.173.161.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 15:42:40 +0000 Received: from oslab-l16.am.freescale.net ([10.214.87.31]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8SFgU5L018597; Thu, 28 Sep 2017 08:42:38 -0700 From: York Sun To: Date: Thu, 28 Sep 2017 08:42:14 -0700 Message-ID: <1506613337-19467-6-git-send-email-york.sun@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506613337-19467-1-git-send-email-york.sun@nxp.com> References: <1506613337-19467-1-git-send-email-york.sun@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510869607715055; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(346002)(39380400002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(81166006)(105606002)(53936002)(4326008)(2906002)(33646002)(39060400002)(2351001)(189998001)(16586007)(316002)(47776003)(305945005)(54906003)(2950100002)(106466001)(107886003)(97736004)(6666003)(356003)(6916009)(86362001)(76176999)(8936002)(50986999)(5003940100001)(68736007)(50466002)(5660300001)(104016004)(36756003)(81156014)(8656003)(7416002)(498600001)(8676002)(48376002)(50226002)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2695; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD043; 1:kaRhX308CZcqVjy4p+aeaAqIitJQbDOppRv5w6beDlRzYA9t1N67aDjSKwELFMCJGWq/hld0f6XQivISHHSn5xfEx52DLEx+9aStIf5l5FXOEBTpN0fF4Mv6EkkFwKjY MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de763c6e-fe00-4cdd-af8e-08d506878d86 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY4PR03MB2695; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 3:pXPiinRgUBN6RUw1Q/PerdTU9WGq+IDIYu0x/h+hN24f9VcPNjDMAsafOTEzHYRN8HMiTJGt0aCHc5J5iruYiGXQpHyrNZ94yzo6EKILlr6CKAymU2Q2Qej3fXUNlAXbzw58DsvzqTT+37wLCipsw5LvEO5+xqSmcD6Dc3eSOjFs2QE3dOI0QeXN43D15WtlN5kag4J468lh8Dt9F4xsw1nTE7tagHL0iHRGjOkgGbz9sUCvVyW+T91jENBPDoOL6tn/lEzUzFrobSCvP8LjS5L/M1O2t1sdyPc3OLpuFqz/TxSWZxd+ASPVgEZgTql+udgkgHVt+XE6aI35bxUmrZzK7ZvJyQZtmBSNo6mayO4=; 25:+lBO7JHbBRxvG0+MIPuM9NKeZ50cNbT2oVsoyPkV0lyc6iDlFGHIcxM7bTYhXNHuBL3+p5+iQ6Mz647xzjdMATSvLpLMu6t0tBY/fSRVvuzhUdqGXUY/30UXDtjCxAS9ekaNiv/I2PK5EKIgd8ZPl3NNVnfVTq/n4+bIXzlGIHB9wSndL1LS+YopfvW/XLvLwynXw3tkcRJwqzUbEX7GuKK7wTXv/m3jRdXb0lCvzBQ6IZQY3lCX/ZAReMM5sJQisbSJWx2H0aGNG+TD+AUoJTfYy75k5+vCpd1HgkzJerbZjxd01QuVGFK0qqKE4+oWW0XNDm9ZvUoHZmibTChc5g== X-MS-TrafficTypeDiagnostic: CY4PR03MB2695: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 31:9/gTqTQrBKTq5mnmzyi+8nzUKQrJa/eQNA58s+D4LVKcmBkgXdAr7zTKLd0RuLUUEeF/arybRvNLhFCkoTtcTKC8DrTPrkOqejjmXZ1Ykg/6lzciwSz5qMNT5rMUIcBd/N3ItO4Fx7lEJeqwsD+rSQR+yFK1oBMs36imhbyYdcyDJTnMX1zwMmO9dcRQRqItpzF3XBujdtQtBFdz7/ImlvKB6RCE6ROtnj+vcS1rkOw=; 4:dMaUkV6Ce6GuyzaXXJF3yVbBUn4kD70qXec0UENkcIoRmrWWUe/+CBLolQDIm2VoR6O/zU3ENcOgsd2Mi6hsYDz+4tpvdCAR2MTtLUD1BCdORjv25bKobcl9dMTJ9G4sx+EPLdqqpvSbHdbhGzJUB6cmFKbWcCsj4/njsfDuRQMSDCQHE8PsLtBpEM0r8wXb0jPlswyeOyALjwI0A96n44rh5W1k+QaOAjgLtB1Mgwcw0mv+WOnIbeWDqiBf7OwegQWyYzIFqWr90P2ocjTE4DM/zhxoEJ0sW0tq5GHBGDI= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2695; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2695; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2695; 23:WCrfO1ZN1GVP9P5j8rlQ3+mdBeOz/fUR04D9W8v9r?= eT4N1gav+rXHSrwY+rgfkV39Oy2wcK53MiKDK2Mp181NjwTQecOWi0WYPdYN0ml1qVuwMzHAk4hkof15bBaqtQV+TtnPNMfTXvEVcutrXcY0IrAqy4CNXORblUOnmRtZyiStTP92iWt4JdQIQAXzmsOkn7Zx3KiIlqUoV6znaNIjx5emNQlwXxaNivns5w5PLkRFeop+za6tHK7/y7+QJxn5jgB6eBR0YJj4zJTC1AFRKY6O+07SVkoY/xm4pIvF2WMlJUMRpYQhyz/rKYGWNPEiohHh7xK4L56rS8hUzCCojdLEe3QTuwrG4+nmtBK/kIicdIeX6WRKqoDZEE27Ht8cx/bEhVoUJOVsqFcm6mQ6jz9yet/jQNZRpxheDZhXQg9GPr4uhepH4sql9Niq5iCzyfZGwqgKQuEUs06tN/0XBcg+7fThzZMkuVsNoy/XMk4V+g832u8CMbhDwZzXJEBTJLj3biaB4cfQeKpTKmh1TzWJq/SPg6gd1+BA1jyjN7JASAXQXcnNO5P0NrHJ7qF/yN4eFoKlyGnG/Ubif5ZpYJgC2V/QYr97DqNI5O5r2hW0pUJ7aXPmMH9eVYO8ST7aXtv7xKy9Wk+18aVUQ6674LaOt8gwATAKsH14GHWS0dAXADEi7hKn7aj10OaDayUBz7jYy9F7NQb3rOBOVJPYnrO2KH/Zo+dPyjslvza1bjg+SeC3vav15rNHMGuyasg6Mt28//4ybOwcXZ5qrWsUxkmfKN0KUR3S679NsqIUlpztbV6ycfMVBIXtIrPM0AVSYBwv0jZjpsRgX2QDGEFB8Q1uCEhlgfA5lrTU2VMLNeR5DZOboNdbmTr1Jm5L/SStLdflyAEGU+Hxo0WhvMg/VEEmBvjFSKTom4tCRwNWn1d+Ejr/jBDxOGqwnYILtXR8n5L13r7c2GBpJhR8h/9r9FH5G5C5jvVLFsOi+fNQJciu4221I3JSztculODW90pTRvWKveU7dsYuJtSsq8Zw25U/L22gWA5rl5BnOMwV4GTcHhhv0LZaPgDuxUWXv4wwqxWCdrEyxmvmGCd+yzBEKJXlbdb43TLxlp8SGcRsUlbc9KHfAOkkPlwwGr4Wtdd631Sn71kBZm9jUGXCv5MuGizi5rOCBwpGNQ3dFv/v/LqO247K44ZG6uyEbgHDZJXlTilJoLdOpV8Igfs4Ozz8g== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 6:pdhozOp45NiRf+q8O5vAItRx1MmE9+LxHO32sO3by23F1odDabrleGCTPuqGZ2Lgtd9fqyMkqhbCBRQTTe+Wc2Vs0uvK0ut996dhBts5wErvygQgocWTWcnewTdoP1qoxARTrFv5F053zzEU5dfWldFm9z5B4jpUM9srqd3AABxpSAB8x9igXQvb6BGPTarGbB7iidwk7dw9UzsAPlJjeHx9gE0Moo9UEKMVkT2mzvf1seaZsuqukcFdj8B8iNsLhAai6rqgUwIWBV//+WlMRD8xIX+3UGuCeclnxzurc6YLHMlIgxkaWZzxrNNICU4yP+fdJiauwqtlHZ+CbMeKCQ==; 5:f7wuzNZRVU2x569zR0bkYy7yLbrXCk+fuE7Zbq/OFlUWg03i+Gcr9t6mvZ7p3ifz62Yf1snH20Piz+727RhvOO7qGzjP66sF2+xJF03C7PbQG5+wBbF5fGbe6LmCH9kOG/r8JDEJVCfDH/kbYu7FSA==; 24:VxVhufUtswnuXDg+5/GaNzW/O1HjqRnTK0vuf6OIhGW7Sl1SWCDkEaU8PBx2AwuAhS3LkiMg3aXKUfokRNYidX/sU5vVIVqXXGMuwH9I9fE=; 7:lJZvVkMz8yxq3JbuMk2vQlAZOPZFYAXgJIEJHkO1wByZZuRit6rJZ0+RTLI3dO4egHFTsjV6EYCvX+OvZ/YxNXUF0zgZ4cVTVhd6qLv6/LaLXme8aj88AutICJEBjn6mv/mTiQGegZMs6dPZEASEie9t+kzjWYdT9abeEolaBE86quXpCsVlVcqJA0+euTUG6UzW1Xmv23RYjaOxEhVSrBM3be7xSWCZZgH4k71Z3qA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 15:42:40.5063 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2695 Cc: Stephen Warren , Vinitha Pillai-B57223 , Ruchika Gupta Subject: [U-Boot] [PATCH v3 5/7] armv8: layerscape: Enable falcon boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add jump_to_image_linux() for arm64. Add "noreturn" flag to armv8_switch_to_el2(). Add hooks to fsl-layerscape to enable falcon boot. Signed-off-by: York Sun Reviewed-by: Simon Glass Reviewed-by: Łukasz Majewski Tested-by: Łukasz Majewski --- Changes in v3: Fix typo in subject and other cosmetic fix. Changes in v2: Relace getenv_f() with env_get_f() after rebasing to latet master. .../arm/cpu/armv8/fsl-layerscape/doc/README.falcon | 140 +++++++++++++++++++++ arch/arm/cpu/armv8/fsl-layerscape/spl.c | 29 +++++ arch/arm/include/asm/system.h | 4 +- arch/arm/lib/spl.c | 11 ++ 4 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon new file mode 100644 index 0000000..282b19f --- /dev/null +++ b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon @@ -0,0 +1,140 @@ +Falcon boot option +------------------ +Falcon boot is a short cut boot method for SD/eMMC targets. It skips loading the +RAM version U-Boot. Instead, it loads FIT image and boot directly to Linux. +CONFIG_SPL_OS_BOOT enables falcon boot. CONFIG_SPL_LOAD_FIT enables the FIT +image support (also need CONFIG_SPL_OF_LIBFDT, CONFIG_SPL_FIT and optionally +CONFIG_SPL_GZIP). + +To enable falcon boot, a hook function spl_start_uboot() returns 0 to indicate +booting U-Boot is not the first choice. The kernel FIT image needs to be put +at CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR. SPL mmc driver reads the header to +determine if this is a FIT image. If true, FIT image components are parsed and +copied or decompressed (if applicable) to their desitinations. If FIT image is +not found, normal U-Boot flow will follow. + +An important part of falcon boot is to prepare the device tree. A normal U-Boot +does FDT fixups when booting Linux. For falcon boot, Linux boots directly from +SPL, skipping the normal U-Boot. The device tree has to be prepared in advance. +A command "spl export" should be called under the normal RAM version U-Boot. +It is equivalent to go through "bootm" step-by-step until device tree fixup is +done. The device tree in memory is the one needed for falcon boot. Falcon boot +flow suggests to save this image to SD/eMMC at the location pointed by macro +CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, with maximum size specified by macro +CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS. However, when FIT image is used for +Linux, the device tree stored in FIT image overwrites the memory loaded by spl +driver from these sectors. We could change this loading order to favor the +stored sectors. But when secure boot is enabled, these sectors are used for +signature header and needs to be loaded before the FIT image. So it is important +to understand the device tree in FIT image should be the one actually used, or +leave it abscent to favor the stored sectors. It is easier to deploy the FIT +image with embedded static device tree to multiple boards. + +Macro CONFIG_SYS_SPL_ARGS_ADDR serves two purposes. One is the pointer to load +the stored sectors to. Normally this is the static device tree. The second +purpose is the memory location of signature header for secure boot. After the +FIT image is loaded into memory, it is validated against the signature header +before individual components are extracted (and optionally decompressed) into +their final memory locations, respectivelly. After the validation, the header +is no longer used. The static device tree is copied into this location. So +this macro is passed as the location of device tree when booting Linux. + +Steps to prepare static device tree +----------------------------------- +To prepare the static device tree for Layerscape boards, it is important to +understand the fixups in U-Boot. Memory size and location, as well as reserved +memory blocks are added/updated. Ethernet MAC addressed are updated. FMan +microcode (if used) is embedded in the device tree. Kernel command line and +initrd information are embedded. Others including CPU status, boot method, +Ethernet port status, etc. are also updated. + +Following normal booting process, all variables are set, all images are loaded +before "bootm" command would be issued to boot, run command + +spl export fdt
+ +where the address is the location of FIT image. U-Boot goes through the booting +process as if "bootm start", "bootm loados", "bootm ramdisk"... commands but +stops before "bootm go". There we have the fixed-up device tree in memory. +We can check the device tree header by these commands + +fdt addr +fdt header + +Where the fdt address is the device tree in memory. It is printed by U-Boot. +It is useful to know the exact size. One way to extract this static device +tree is to save it to eMMC/SD using command in U-Boot, and extract under Linux +with these commands, repectivelly + +mmc write
+dd if=/dev/mmcblk0 of= bs=512 skip= count= + +Note, U-Boot takes values as hexadecimals while Linux takes them as decimals by +default. If using NAND or other storage, the commands are slightly different. +When we have the static device tree image, we can re-make the FIT image with +it. It is important to specify the load addresses in FIT image for every +components. Otherwise U-Boot cannot load them correctly. + +Generate FIT image with static device tree +------------------------------------------ +Example: + +/dts-v1/; + +/ { + description = "Image file for the LS1043A Linux Kernel"; + #address-cells = <1>; + + images { + kernel@1 { + description = "ARM64 Linux kernel"; + data = /incbin/("./arch/arm64/boot/Image.gz"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0x80080000>; + entry = <0x80080000>; + }; + fdt@1 { + description = "Flattened Device Tree blob"; + data = /incbin/("./fsl-ls1043ardb-static.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + load = <0x90000000>; + }; + ramdisk@1 { + description = "LS1043 Ramdisk"; + data = /incbin/("./rootfs.cpio.gz"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0xa0000000>; + }; + }; + + configurations { + default = "config@1"; + config@1 { + description = "Boot Linux kernel"; + kernel = "kernel@1"; + fdt = "fdt@1"; + ramdisk = "ramdisk@1"; + loadables = "fdt", "ramdisk"; + }; + }; +}; + +The "loadables" is not optional. It tells SPL which images to load into memory. + +Other things to consider +----------------------- +Falcon boot skips a lot of initialization in U-Boot. If Linux expects the +hardware to be initialized by U-Boot, the related code should be ported to SPL +build. For example, if Linux expect Ethernet PHY to be initialized in U-Boot +(which is not a common case), the PHY initialization has to be included in +falcon boot. This increases the SPL image size and should be handled carefully. +If Linux has PHY driver enabled, it still depends on the correct MDIO bus setup +in U-Boot. Normal U-Boot sets the MDC ratio to generate a proper clock signal. diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index 2534b4b..bbb9ab1 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c @@ -117,4 +117,33 @@ void board_init_f(ulong dummy) gd->arch.tlb_allocated = gd->arch.tlb_addr; #endif /* CONFIG_SPL_FSL_LS_PPA */ } + +#ifdef CONFIG_SPL_OS_BOOT +/* + * Return + * 0 if booting into OS is selected + * 1 if booting into U-Boot is selected + */ +int spl_start_uboot(void) +{ + char s[8]; + + env_init(); + env_get_f("boot_os", s, sizeof(s)); + if (s && (*s != '0' && *s != 'n' && *s != 'N' && + *s != 'f' && *s != 'F')) + return 0; + + return 1; +} +#endif /* CONFIG_SPL_OS_BOOT */ +#ifdef CONFIG_SPL_LOAD_FIT +int board_fit_config_name_match(const char *name) +{ + /* Just empty function now - can't decide what to choose */ + debug("%s: %s\n", __func__, name); + + return 0; +} +#endif #endif /* CONFIG_SPL_BUILD */ diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 79bd19a..1d7d4f3 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -215,8 +215,8 @@ void __asm_switch_ttbr(u64 new_ttbr); * @entry_point: kernel entry point * @es_flag: execution state flag, ES_TO_AARCH64 or ES_TO_AARCH32 */ -void armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr, - u64 arg4, u64 entry_point, u64 es_flag); +void __noreturn armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr, + u64 arg4, u64 entry_point, u64 es_flag); /* * Switch from EL2 to EL1 for ARMv8 * diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index 27d6682..ab5d227 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -7,6 +7,7 @@ * * SPDX-License-Identifier: GPL-2.0+ */ + #include #include #include @@ -47,6 +48,15 @@ void __weak board_init_f(ulong dummy) * image. */ #ifdef CONFIG_SPL_OS_BOOT +#ifdef CONFIG_ARM64 +void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) +{ + debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); + cleanup_before_linux(); + armv8_switch_to_el2((u64)spl_image->arg, 0, 0, 0, + spl_image->entry_point, ES_TO_AARCH64); +} +#else void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) { unsigned long machid = 0xffffffff; @@ -62,4 +72,5 @@ void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) cleanup_before_linux(); image_entry(0, machid, spl_image->arg); } +#endif /* CONFIG_ARM64 */ #endif