From patchwork Mon Nov 5 18:44:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10668915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A977B1709 for ; Mon, 5 Nov 2018 18:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95F63295E2 for ; Mon, 5 Nov 2018 18:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A33429973; Mon, 5 Nov 2018 18:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 26E7B295E2 for ; Mon, 5 Nov 2018 18:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nlSsbdTLNqcC4MZ27QuWpgFKOjdQntK1dlmos2GU+L0=; b=rxroHCveDgivvU vc/QzOg0fFFnjAdpqRVOIT39Io3wmMnjRcbfuThcrdgpPa1c5PtVtMfmpISHNc1/zTRzm7kDZi4V5 Wku18p+TNlq/J2uOUEE079fIJJV7y09QRILwEd3wd1Vg+nEyW6Kt1u1KdOjaNcWwFB8Gl3AkVJUVv jkTNIUCG4Mk8T6Y0Wb8EJp2Zs8u8EegES2GH3TEg9zOK9qHn9AkY21eZ3zqYV3a/Irn4moOZ/u3JP 8csWYfad3jN7i/7y/mZ3ETWjpQ7hhNctjj0SdUM/M6aCYLytQe0FTHMuof84ekbv+YZT6o5+vWwL0 YqN6J980n6/pYBDPha1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJjsE-0003JO-6O; Mon, 05 Nov 2018 18:45:18 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJjs2-0001uB-CI for linux-arm-kernel@lists.infradead.org; Mon, 05 Nov 2018 18:45:08 +0000 Received: by mail-wr1-x443.google.com with SMTP id 74-v6so10670251wrb.13 for ; Mon, 05 Nov 2018 10:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IpWvbXdcdrM8X9iK+uhwxv0ZJoRb9Mwa9uub3GYMOFY=; b=Mi426MLo9p0TncrToFHcsMt2qrduEGY5v9tvo3CmGnLa7bdJoul9/dzj8ek/+3A/1m HK37JSpb9KPmyzdPr5JSphpQIY74unN71rWLtfSNVhnx7HaiwIN367u/pLI1wMNPk3wJ GDamGhp0LAgrcmmOOslaagupN5fpH6S5+bufU= 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; bh=IpWvbXdcdrM8X9iK+uhwxv0ZJoRb9Mwa9uub3GYMOFY=; b=paa16T1Q9x5NhbnidZ6Wp3PN9lJHTa6RX30/7UiPQIWWq8vfZcUKo1aho1q342hS08 e9dCt3hqK543C0ePO4bE13aUTqFB4qdXOYAa+aUVWH8FXEj0hW/W13YedKIFFV4+h/F9 ZFomwtSU5IMqDg1Ag9urArnJzcFLYLGjD1JpAXj910apBWvota63W/6mhi8R9NndpFQE toWxOVYnLUaLfU/Bu8lwjZK85SIrGnbg4C7FAzai09kWJxEw2IN6Elh2HhlT9ukv/2+g xhrsBkRNAAe17TUtXgYYWMWzuRzhZG/udPGGI8NyyPH5ctBfP+EM9G+Lfg4X5ygpGVE0 lCTA== X-Gm-Message-State: AGRZ1gImhh2GhA+4bqEBY/OGrTPLGyPbGS+p8bZ9P5eWZwood6ZSpOBZ t0r/1gm1KHEdngBFvdUTxv0fp9piX5Y= X-Google-Smtp-Source: AJdET5frD3sMesnsEtneERUnMdLic+9nnvG2wRmyn/38s+V9iKvAE8ZYx4RN2kqAIx/G7vw+Acg2nw== X-Received: by 2002:a5d:46ce:: with SMTP id g14-v6mr20144283wrs.263.1541443493196; Mon, 05 Nov 2018 10:44:53 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:3117:2b29:5ef7:a9e5]) by smtp.gmail.com with ESMTPSA id y21-v6sm19329761wma.36.2018.11.05.10.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 10:44:52 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/6] ARM: compressed: move sharpsl startup code into subroutine Date: Mon, 5 Nov 2018 19:44:33 +0100 Message-Id: <20181105184438.19494-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181105184438.19494-1-ard.biesheuvel@linaro.org> References: <20181105184438.19494-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_104506_516341_97274EBD X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, linux@armlinux.org.uk, Ard Biesheuvel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of relying on unspecified linker behavior, move the SharpSL startup code into a subroutine and call it from the location we expect the linker to put the code. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/head-sharpsl.S | 24 ++++++++++---------- arch/arm/boot/compressed/head.S | 3 +++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/compressed/head-sharpsl.S b/arch/arm/boot/compressed/head-sharpsl.S index 992e784500fa..f4e6ad318376 100644 --- a/arch/arm/boot/compressed/head-sharpsl.S +++ b/arch/arm/boot/compressed/head-sharpsl.S @@ -20,9 +20,10 @@ #error What am I doing here... #endif - .section ".start", "ax" + .text -__SharpSL_start: +ENTRY(__SharpSL_start) + mov ip, lr @ preserve lr /* Check for TC6393 - if found we have a Tosa */ ldr r7, .TOSAID @@ -30,7 +31,7 @@ __SharpSL_start: mov r6, #0x03 ldrh r3, [r1, #8] @ Load TC6393XB Revison: This is 0x0003 cmp r6, r3 - beq .SHARPEND @ Success -> tosa + moveq pc, ip @ Success -> tosa /* Check for pxa270 - if found, branch */ mrc p15, 0, r4, c0, c0 @ Get Processor ID @@ -55,30 +56,30 @@ __SharpSL_start: ldr r3, .W100ID ldr r7, .POODLEID cmp r6, r3 - bne .SHARPEND @ We have no w100 - Poodle + movne pc, ip @ We have no w100 - Poodle /* Check for pxa250 - if found we have a Corgi */ ldr r7, .CORGIID ldr r3, .PXA255ID cmp r4, r3 - blo .SHARPEND @ We have a PXA250 - Corgi + movlo pc, ip @ We have a PXA250 - Corgi /* Check for 64MiB flash - if found we have a Shepherd */ bl get_flash_ids ldr r7, .SHEPHERDID cmp r3, #0x76 @ 64MiB flash - beq .SHARPEND @ We have Shepherd + moveq pc, ip @ We have Shepherd /* Must be a Husky */ ldr r7, .HUSKYID @ Must be Husky - b .SHARPEND + mov pc, ip @ return .PXA270: /* Check for 16MiB flash - if found we have Spitz */ bl get_flash_ids ldr r7, .SPITZID cmp r3, #0x73 @ 16MiB flash - beq .SHARPEND @ We have Spitz + moveq pc, ip @ We have Spitz /* Check for a second SCOOP chip - if found we have Borzoi */ ldr r1, .SCOOP2ADDR @@ -87,11 +88,12 @@ __SharpSL_start: strh r6, [r1] ldrh r6, [r1] cmp r6, #0x0140 - beq .SHARPEND @ We have Borzoi + moveq pc, ip @ We have Borzoi /* Must be Akita */ ldr r7, .AKITAID - b .SHARPEND @ We have Borzoi + mov pc, ip @ We have Borzoi +ENDPROC(__SharpSL_start) .PXA255ID: .word 0x69052d00 @ PXA255 Processor ID @@ -147,5 +149,3 @@ get_flash_ids: ldrb r2, [r1, #20] @ NAND Manufacturer ID ldrb r3, [r1, #20] @ NAND Chip ID mov pc, lr - -.SHARPEND: diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 6c7ccb428c07..5067f287fa5a 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -213,6 +213,9 @@ not_angel: */ .text +#ifdef CONFIG_PXA_SHARPSL_DETECT_MACH_ID + bl __SharpSL_start +#endif #ifdef CONFIG_AUTO_ZRELADDR /*