From patchwork Sat Jan 1 17:13:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574497 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=o+2Z1ASf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7tH67SMz9tk2 for ; Sun, 2 Jan 2022 04:15:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8651A8305B; Sat, 1 Jan 2022 18:14:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="o+2Z1ASf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E880A8141E; Sat, 1 Jan 2022 18:14:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 80B6B83022 for ; Sat, 1 Jan 2022 18:14:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HE1ZE020330; Sat, 1 Jan 2022 17:14:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=5EYkl2vfvFZWYmchEWv8JKTRpDWjqhyV2mklM5x/jz4=; b=o+2Z1ASf+RNlilKnjL+EacJfHSzNGMiQiBjsyKySZmLi8DjHLiOTrs1PvWiwGCpYv9rj xprc5kBNhPAvbLCRD3EoCk/ClJVZu0UGBoU/hFgEb5zs/0KHC9hlvCcXPj4CWLCYZkpr QFZD6Qa+C4BYproMZB0qFRPHpHxsYogKV7PB0XGxts2/VhiXr79/YDabQg2oXdVULQ1Y bsTq11l8xdwQLJ7qkX3BBUu2HTrEPwwpTEdhiZHiuRvZ6qp8+PpdNXiGQtgtkTmviVD9 BcXgTW4jg/y5TZMfmrFTMICm6BR3h+/30VT6RAoqUKhV816tkMO0RY13Mo7KNXtvxgif 4w== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dadx808rm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 17:14:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NoiCQvo/NhBfhgm6nqth0PePItZkx4o+dEtwvBLYFFGroMNoHbWmS+Ah2gGKQtTrJBRybwujh9l1HOcwevGNGkh1M49syhxVOlSE7miw0bEAVcnexsdK5MlE18j81Wn8DnL1MYMUmRQfE87hA6EXrQGUXjJ+KnIAuENsj1bv81tu8zAfzqflbQVTGktOqadZQP0R8L7e/EKbBQ7aOKgDj49x7rJZlxhf5BL4kBFvDy3FcaNNFp8Neadwv0Gm3g1e+TaDuY2/DOhrX0psJTOvDkVrkhV+FJtYKm1AHJyLIguyLw52OckcX2Causc+ZZpEUtjpqmM3KlSt5AF+gXQiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5EYkl2vfvFZWYmchEWv8JKTRpDWjqhyV2mklM5x/jz4=; b=ct1ivN5qvHil6UY4wbjkQ83eCpUOl4286hKtHpp7m2oaIYgAdoqh47UucWRS96pePUjm1roV/DA3Bzaizn5CIuwNKJEgFGcbI4MdkJ5bHFjofNXnTdritecGPXOVB9hkMoOc0jk0xYyOB0SCmro+IBmTXfgxT+i/NICJuZ1jhvZKVyykqI84MJ7xkzpJjpRlH6KyyfRhTmaqNqXaBA3P+Hb0bIEgXwbAqbm76PMfINLBZqVF+qyMAjwoT2tNj/dBp4/tPBsWY+lSVBuSxExluY/bZ9BOr6MD5gOrPH6d8mOTU+9OsHHpVTLCIGMup1MMxZOVPBzCvzdWnDlbK1k9uA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR11MB1353.namprd11.prod.outlook.com (2603:10b6:3:a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Sat, 1 Jan 2022 17:13:59 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:13:58 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Simon Glass , Alexandru Gagniuc , Bin Meng , Harald Seiler , =?utf-8?q?Pali_?= =?utf-8?q?Roh=C3=A1r?= , Patrick Delaunay , Ricardo Salveti Subject: [PATCH v2 1/7] common: spl: move armv7m-specific code to spl_perform_fixups() Date: Sat, 1 Jan 2022 19:13:25 +0200 Message-Id: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 213a6def-1d6d-4f1d-837f-08d9cd4a1943 X-MS-TrafficTypeDiagnostic: DM5PR11MB1353:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:317; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u75bc41qCRrsgUXxfydyNjobkMDQsRIlqg5cqWiPYI8AKPDN9xO/WIIsRKqREToZgBk3XMJZ6JtKwTJkGKdzKNTOArFcNOreWA7GubvmqzjLIva8kQ2gTu15X1IkDyP11P9o5AYlOSjN0r19FEpkWBMynf7f4apSp5gE/fIX31HVa9OU2xOZD3Mzly81y5oOG0gmyp1tJFjeqz/0dmWjjzDGe/U0FvzC3xkF5mkJ0yCF/npll6IJwE2X8C7h8dW6RyXtISi7eQqcsOMwaFxpnycCWgp6u/Rn8SRTLMv9aqK8VYAWhNBMrV6idq/rqzf7mU25KTscsOQeNsHDPlD8J9rO9zCkZz+QPgahTvcaw0wVzVwB+qfJ8Vkg4b5BtRwvufQ/jSWjnIpD0NmVk68ANBJcHy+1GAtdKRbDp74xStZXI59k7P+Q8HdC8cBHAObrAgEuJ4enuKwhIbLfumXNimw2AfiUf13kSoJfj6QRbm6bms3AA7jeX39a6jUU8SmU0tM0xfQ0fFQJg2/DbgW0xbMMNC7XYq3hlC+2xvOdVLxNPmyogKKPekGIBSF+4h1NKj35p0fJkCvGk7YeackJ35ts/Vkw3XiAau2BMrvjwWMP9gE4UliSWZzzP0VlgGJRmiyvuSqRR6pKMPm16tpo5l1bhmlN9Vm3iW6wHYVoMlUaK7/Vh1lcJDGMlnGEJp0JQfOJlUPqoAXC3nTIBwFCHw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(4326008)(86362001)(186003)(6512007)(36756003)(38350700002)(508600001)(5660300002)(6506007)(26005)(6486002)(66556008)(8936002)(2906002)(54906003)(316002)(66476007)(44832011)(6916009)(6666004)(1076003)(52116002)(2616005)(8676002)(38100700002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OHTyPECMOzGJ2Ux9YlBpK7YOGZVFVh+VVX8lHvYicfkPk/trQ+ycqoRICO9EDId7xT2Lg82dQQhSJik3mV4xfLzioxLunrFxr/k43KMdi5YHhJ6os8q6KK+zdmhUbMlSUSpEztHulg6zr+Yf1xjQA9oFwokjAPTEu5csq0XXAxmOqLUWt8IW0tkdYOgJFjZlie5O+9ACXt+ZM96TuwFgfgg21g1OVM5V76Co+hzWVvm4/eTGLPbnHcC1qQMJTB4jUraEUTC4apJC5OspJbfBXM52hW8E3VbzQcHmicLZIfrkjfJF1ehxFXexzd0WsuPrcm2MY5z+pTxXWuybFBArO80irQsNBy6ALuIMtin2aTGb/HPZb8LvfCUXk3TXAdy7GsxUgDl3XnFtlAkOUgs6wJHL5dTKSBdDaASjsI0nO9UPXiuIv2pm1GG71G53UtbHhH0IEopstNDpsGAQR4pW0JRgpgWs67+GrXzXcJhou38VG+UDgmyu7VOrvcwcLVrKUia1O9/bqBKNmyWnIYAXV7IS7kpdZtyhTQgsxASYY9NiOuvZpCcT9buMJAEebAyFTjM1yNAeqLXQNB707k0CHXae/MHvAZcIuhWXE9/P6U/ncdNZB7y4Tde8XAGgfhLAtcLPWPy2h1A1tSr7WIgpFKq+Rto8zETG6hD+m5S67H4EP0/f/5xm2ciPXEJuUzNeosl6iEGg8oqiPSRTkwoVSPp0T+ABEFRvzHfT9hZ5vIbvDPd1iqxtHXuzZ0jazgpiKACLcwjb68xrRbfiSHNC7EDfYhu1KmWhg9LKYi4nfPncmUH98OW5RtGmmzKaycIN1m458gHQ+FfWj/Qzb5XSojGwqSUYlG20EVCZkXTzKwnJZL6OkIT5WmpPCGiOdU7LI3kgePHj4IeimmsgHumr9pdB52CVUJrztJeLMEo0m5X9Zq27JbbK9L5U6MD2z4fRIxIO7kv18xwF1NpLpcnx/JySfUbZEKO0QcF9BdHhRLkTxVlCeEtbRgvMLqRROrWVDEAIXo2VT9kWHxH+VK49s7M0eBoHLk33wwJxPNMrBlNUch5+DBSSUNlrRwre1AIFCFxZrH2a+55dwCTVD/VbqQePspB7oNl065MrHx+08PoGlRjZqxwH5z9L2HfAH2wn0f7XjThl6iNamFRkQml6ceTVvRYOxVsC1Bax7sfEnObTIOT1IO2TMPt0hPbsHFAI/W89Dg7oSsqR6VIQpriVU0xppfe6G1+Y5YCzEMHWDeueNpiclgIuukKLfnU3k95CKElRQ7Uex4WKRYv3S3oc2wGnTflM+Qjbwoz7gAu+fUB8h9VRjXTK4RwPtkbmPRRk7g++SeJzR41OII+Y07fYVjJ3v0GTLOLpwkfjBdc3r+w/JKoNNgFypP0c7XEPbZbrfIe1KOJ1qHYW5sD3nAeZ7pkrXU2HZ6k8Xo9/BJnsN1Aa/CPVC0IOYv3TduPS753qzXOJLj7bMKlmgn8TKgxcPRq+VBhIFUWFlpuw8glFdVKoDdnfP/JEPyI7lZJvW6vfCmCIGYqp0P20damg3aVuOvdsMM8WfyH+cvY36brXlVEAB9DEAMbCGDW4OXRhkZ3VQSQcjuTQOH/7jd8yCvrswXEssl//iS2zK+4PfoKdHO/Vav8dS+BvMxEvrR47TrQTGhAi19BhhCp4Dj2T26SbCg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 213a6def-1d6d-4f1d-837f-08d9cd4a1943 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:13:58.8357 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uAQFU40lVp6sYU+tFgs9Net4icbfRw14X1txcGNbUp9nZ8VtSewOpccclluukDRdgsITG0itXtwugSuA92CUa7+oHLr3d3QztM3U7Kx4FJI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1353 X-Proofpoint-GUID: kOg0tPi_q76QnKXLVA04yl7vdlNhR0bN X-Proofpoint-ORIG-GUID: kOg0tPi_q76QnKXLVA04yl7vdlNhR0bN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=830 clxscore=1011 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Factor out armv7m fragment to spl_perform_fixups(), which is an arch/board specific function designed for this purpose. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/cpu/armv7m/cpu.c | 6 ++++++ common/spl/spl.c | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7m/cpu.c b/arch/arm/cpu/armv7m/cpu.c index 63721018c1..65427b5312 100644 --- a/arch/arm/cpu/armv7m/cpu.c +++ b/arch/arm/cpu/armv7m/cpu.c @@ -12,6 +12,7 @@ #include #include #include +#include /* * This is called right before passing control to @@ -56,3 +57,8 @@ void reset_cpu(void) | (V7M_SCB->aircr & V7M_AIRCR_PRIGROUP_MSK) | V7M_AIRCR_SYSRESET, &V7M_SCB->aircr); } + +void spl_perform_fixups(struct spl_image_info *spl_image) +{ + spl_image->entry_point |= 0x1; +} diff --git a/common/spl/spl.c b/common/spl/spl.c index 4c101ec5d3..dab0f5fe38 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -770,9 +770,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2) ret); } -#ifdef CONFIG_CPU_V7M - spl_image.entry_point |= 0x1; -#endif switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to %s...\n", spl_phase_name(spl_next_phase())); From patchwork Sat Jan 1 17:13:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574560 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=IWHE4A2p; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JRfpV0pm9z9s3q for ; Mon, 3 Jan 2022 00:28:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C51C82F5E; Sun, 2 Jan 2022 14:28:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="IWHE4A2p"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB95782FD7; Sat, 1 Jan 2022 18:14:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5B18B811B2 for ; Sat, 1 Jan 2022 18:14:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HEAAm018804; Sat, 1 Jan 2022 09:14:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=HnqiGmCpaJY1R6XwMZKKuJWaZBzhR4LqYTfh1iyl4hE=; b=IWHE4A2p9QiHIKtPPgt4AO/2Hf9vXba1SZrjZdQw5k4A4PTbiqAWb44giZH8pqYxAHIt yWhAcnQwPBTTZIGFdrYpLGgot3I48QJL/7CLvvldk0hg+S+8YDq+pkxhY7qH+Z1E613i RzgCynytwcfsGKn2tbss4hlEaD3hy2sxsyemG+F8u7iZGZW3jz2O0e1xB9BBI9bVXU5y pVUN2uVmrs2rImZ/jm0tKosVGNxK64hspRyHYPO4RTPshVxZzv1qZK5q/pfDdbsJE7RF ex7lNF/TUv8kmV/REr6ykGOdBthuiBTivTUInzYDVMOXm+M1O7pR3ZPNjtA0TPQFqMKi UA== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dak4705gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 09:14:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RReM+BxTeOAmQ6bDpyDVA7rlxLoegDRL06YFSipdWXYzXo9WIn+g6uhIZ9NVSdT46DFZ0J4MLT0Pw9dOYuzew9Yto1KLgxmk16gQi4w4XtqfgesaAAFiqq3S1rXlE2S4XO55kmdQzenTitbkWWsX8nCeJ/g1KCJIAaQktArMbqX7h0u3iH1+E6FiyKAT49u59ywJraHEZpnaI5quqDaMl7KbKQOtmbDmVe4cBZ6sLGSPv0lcOSLTjtmpeBVGD0ObV5qpgpM61ksvFr6X4yO6yYMmKHykHjXKc7SgzlIWlf+17Vtp1Eklfu1ysguYGCxfSrM/s7QKGtapjDNFCsS1AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HnqiGmCpaJY1R6XwMZKKuJWaZBzhR4LqYTfh1iyl4hE=; b=L4uDnqyfHTwzAsvROWGzPvKuex0ZphVFuWQQGCg8qYbN4WjtQ6uu0HnoonFK+msUQNPKN4O1tlar8BrU+uM9pMHe6Y8jec1Yt9LUEMSB+1Snw+/e4T8W823Dr1qRcBWHlyKntm0WJruApBrTuAK4zHayErp+gA7VEb39ptS89X2W+fB8gEXmm2iFln8zZIqyzcMuMucg0YO/8jlSm4xQhQZkqCao2tVXPXv8Y7YcaK9MNV0eWSxGbpsjlijnJXekt85pwdR2YJBkgM6BpDW++F8qSU7Zffke3eyiU+YLMnL4YrcDJ8Fi9Mj+VZ7/BVXbRWsc/RgICMY5oqdg6nS3Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR11MB1353.namprd11.prod.outlook.com (2603:10b6:3:a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.21; Sat, 1 Jan 2022 17:14:04 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:04 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Alexandru Gagniuc , Asherah Connor , Aswath Govindraju , Aymen Sghaier , Bin Meng , Chris Morgan , Franck LENORMAND , Heinrich Schuchardt , Joel Peshkin , Jorge Ramirez-Ortiz , Kory Maincent , Marek Szyprowski , Mario Six , Maxime Ripard , Michal Simek , Peng Fan , Pragnesh Patel , Priyanka Jain , Rasmus Villemoes , Roland Gaudig , Simon Glass , Thomas Huth , Tim Harvey , Wolfgang Denk Subject: [PATCH v2 2/7] common: remove bedbug debugger support Date: Sat, 1 Jan 2022 19:13:26 +0200 Message-Id: <20220101171332.2676936-2-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: edf7ea8f-17b6-4743-ea14-08d9cd4a1c6b X-MS-TrafficTypeDiagnostic: DM5PR11MB1353:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wf5EzjLcrm979XuuMjDdxwD2miuTGKh9T4gCu7bm+8DqMIMygpFWyCPic/Ve4iDjE8fA1ocQFrllvcw3y6f5FrSuhZWLptlW48Ljer3AgUMbCbfgsdwd1fv7KZTzJQzqQRQ8d842wECU2lLMtWCFANgDGckd6lDzA0suCEI83Z6mxx9gfyAABlt0x99AqGnORQmSingPxl6xIRZ/tIwy/+6xJuef6o3PWj7mRdywREa0opv7X+EGc2s6qI7WvLqfjkJoZyD7rPrTe24+zqZnwahq9Fz6PBk0BFH8pcBuB4zNwdl04C2wBHsSqfOOTPbCvoWCqeLk848yP/EpFHFImi3G6MJQJhnBpdYkWT524bJ4eEzuKP6tmZnXxurMDqcq27NaC7h8mtBWZqIbjJSYk/5gIrE88UKbZnxzyim063Ho8OwHhsbdy6RmqWKg0rsC66fGvnvpqQ6b/T7YmQJkjXfooEVuyeBrwmKbcgtjrjvB3JiCkfoFaeiQa/OdAtE+aGDGUBDwBEeF9CjC9mtQcs0ftC/rVz9NMtjIXIU2BVrHiv8LZnxPxeLRc3TQqwEiWjkHLsOfoomhGzRX8RdusEAZVvbjstOO4xWtsgeUdSm5X8b78qLorvFdrZMg/g6zMub12DhRuXu9iXM4cswqKwdjIlslrb+Og/6HOn5l8hTBSaUkA0aOyL7Q8IccgOoo/bbwhxbw2y7AVbbQtWAYp5efBTDFIhnCMmN0KO6uMXY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(4326008)(86362001)(186003)(6512007)(36756003)(38350700002)(508600001)(5660300002)(6506007)(30864003)(26005)(6486002)(66556008)(8936002)(2906002)(54906003)(7416002)(316002)(66476007)(44832011)(6916009)(6666004)(1076003)(52116002)(2616005)(8676002)(38100700002)(66946007)(21314003)(579004)(559001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4HLlEjbXdEHSsgYopK/TcB2gWlzglNf+mewiP79oSF0jUo9k2A4Qfoe93TDKuZK7nnh45zLdA/n9Bg8ekfwJqYrM54YxxNbqG/rQRXy8oM58UKZcQGOrrvkwKGTVPEs+U5BDvFcVvINHl6hD1JzVtTuEh/EaBU75ruR82gbinmK+CI2VkBizYGXUCfvI5QjYxX4tblUAyaWgHshw07iGJ47dbPhOaXamipiNHI1J8HaOvqmN7VRWu6GCxAAzRieoKVABvfX9kHvnR/0MFrR0z0dF0HHFI6OyUAubRQYEGSWIzh5fDaj/urL7UWd5PSj/8gpftp28HtWJGT/kfED4qOiNxvhQji6l0hqWf9ISW8kw6xJwVPa52Kz7xSnjEXLccc5UEK30uc2oAkcsv/iM8j1wpaWWCIArOF5X+3yyCafKT0+BNGDRRmSc6sKsOxKZYTMgaedNpjPv30293rm2+XQSPCnxf8TVSkm1LVTy0HBlTlClzJQG6pZSyZgNk9rnvPh4zc1vpmfv8SnN64uX6hFH1uSUG6Ydk2AovUWuOJ/P35PeeQHGQao3pmb4uKytJgnIrGCMKkexnBuVjzo/aOmOFsfarD1kg6cbuBe+709fW7PwJgzsBpcpyD497+UGkOw7qF2qAP+QBGsg/Tq24rsUR7ptYwfbvPpodMD6NsAOAeYF/E8I+MNFCPR/qpZg8G/PUUHhPJ3BqUIWsQCQUHzzyRpz8ViOIIvsGlpSAmuveLHULtX7dRHd4TuuHV6GMuamliPLuwWYOoY3cmnjZc/ZHuZh+w3IAN9sM0RDHtN66elbWCP2jy5J9XPdRfAthE61VL8Jzj/FSXdZbUUQphiiwUcvZEXL68mjk3dG+oTVRodR/djP5841dxfVyEidDbjfUt4/yMFelpNMZfDOAmh2Geup0SVitSxFEnu7LQ9cfhMvGbDWigTrbPBM8IYmz7a06mbwZ7aSKM/Yr5HLusKYtWTIUYaF+NJAqYT7ibHfAGmu3KtiAm7s373OD5eMh1IWqAmBclDW/c3WTe1UsdtglP7gZo1Xx1VRCCUyBTHWZ/i0ORWwwx9Fz7p9mLB2n8GAuijQgVR4Bo7+sO0Lm1muwojm0uRzhE3Ju/j0gA6Z6wjzwD2hfnEn/nwK1Zz8K9IBEi4RF3mm+O93g9jOQqZ13vgmmBu9scgAEO4cME/Cssmy3jBeNTLPLga3KslVa30skTuvPUNB4nhRqKzak5ivsAAAtZxV/7qH2VV0cbSxkozZ8X/3ncn/xwg8ECR9SbXFto8J1uNwTk+NWN1ziBbrtQLi8v+xG9z6KcNAob9HmjtAeBM3gLAfFlYNS/j0dhoBdrr6vadtmFMX0AwiSE3KL5Tm1hueXgqNl61WauMcVZY9FH1qED5OHR+Q8gTWPU8yqGDab3vpr9opjwPqRnsrQVDqqufHirIhVLOGqEsYz+CIOC6M1lpPi5qjeKzciDlwFW8YWQ2Qd6fMIk1U961zwmwnz5aOTAcN6c2yGsEIcQU1GR5qCcdj2KJaW7pO2AlZopXeI8sNlkonKUu7beRGHmi93vL7UR1sccpxvy0ikWCvzEYYMacV/xNU5JJDdnV1hIxq37IqVSSNCMdcPfvC/KnqpzXZKTZ7bVeUcPAv8JQqJdpyz7iFSmoM1Q+a/6N5OZG/eN4W+8AdNAd5vA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: edf7ea8f-17b6-4743-ea14-08d9cd4a1c6b X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:04.3380 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /vKhU/6EvXOFJGJK1Neeq+qoFX+HqBHt0jgAx1C7qc47A54IYVkx+70sDrhi9eqXYsrTzJspeFQRUvIGk4JKq30TGCaly++qoAUNf/h8zZA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1353 X-Proofpoint-ORIG-GUID: SXWulv8TK7fRQPY1527mqyQmgHsWNRrd X-Proofpoint-GUID: SXWulv8TK7fRQPY1527mqyQmgHsWNRrd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxscore=0 clxscore=1011 impostorscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-Mailman-Approved-At: Sun, 02 Jan 2022 14:28:17 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot. Signed-off-by: Ovidiu Panait Reviewed-by: Thomas Huth Reviewed-by: Simon Glass --- Changes in v2: - new patch arch/powerpc/cpu/mpc83xx/traps.c | 7 - arch/powerpc/cpu/mpc85xx/traps.c | 7 - cmd/Kconfig | 7 - cmd/Makefile | 1 - cmd/bedbug.c | 410 ---------- common/Makefile | 1 - common/bedbug.c | 1254 ------------------------------ common/board_r.c | 9 +- doc/README.bedbug | 56 -- include/bedbug/bedbug.h | 40 - include/bedbug/ppc.h | 408 ---------- include/bedbug/regs.h | 400 ---------- include/bedbug/tables.h | 601 -------------- include/bedbug/type.h | 29 - post/lib_powerpc/string.c | 1 - 15 files changed, 1 insertion(+), 3230 deletions(-) delete mode 100644 cmd/bedbug.c delete mode 100644 common/bedbug.c delete mode 100644 doc/README.bedbug delete mode 100644 include/bedbug/bedbug.h delete mode 100644 include/bedbug/ppc.h delete mode 100644 include/bedbug/regs.h delete mode 100644 include/bedbug/tables.h delete mode 100644 include/bedbug/type.h diff --git a/arch/powerpc/cpu/mpc83xx/traps.c b/arch/powerpc/cpu/mpc83xx/traps.c index 22e451c58d..94e6323d73 100644 --- a/arch/powerpc/cpu/mpc83xx/traps.c +++ b/arch/powerpc/cpu/mpc83xx/traps.c @@ -204,15 +204,8 @@ void UnknownException(struct pt_regs *regs) _exception(0, regs); } -#if defined(CONFIG_CMD_BEDBUG) -extern void do_bedbug_breakpoint(struct pt_regs *); -#endif - void DebugException(struct pt_regs *regs) { printf("Debugger trap at @ %lx\n", regs->nip ); show_regs(regs); -#if defined(CONFIG_CMD_BEDBUG) - do_bedbug_breakpoint( regs ); -#endif } diff --git a/arch/powerpc/cpu/mpc85xx/traps.c b/arch/powerpc/cpu/mpc85xx/traps.c index def47285ba..97ed24a6eb 100644 --- a/arch/powerpc/cpu/mpc85xx/traps.c +++ b/arch/powerpc/cpu/mpc85xx/traps.c @@ -60,10 +60,6 @@ static __inline__ unsigned long get_esr(void) #define ESR_DIZ 0x00400000 #define ESR_U0F 0x00008000 -#if defined(CONFIG_CMD_BEDBUG) -extern void do_bedbug_breakpoint(struct pt_regs *); -#endif - /* * Trap & Exception support */ @@ -285,7 +281,4 @@ void DebugException(struct pt_regs *regs) { printf("Debugger trap at @ %lx\n", regs->nip ); show_regs(regs); -#if defined(CONFIG_CMD_BEDBUG) - do_bedbug_breakpoint( regs ); -#endif } diff --git a/cmd/Kconfig b/cmd/Kconfig index 02c298fdbe..a6f95b1813 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2303,13 +2303,6 @@ endmenu menu "Debug commands" -config CMD_BEDBUG - bool "bedbug" - help - The bedbug (emBEDded deBUGger) command provides debugging features - for some PowerPC processors. For details please see the - documentation in doc/README.bedbug. - config CMD_CBSYSINFO bool "cbsysinfo" depends on X86 diff --git a/cmd/Makefile b/cmd/Makefile index e31ac15ef7..abf5d2a55d 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -22,7 +22,6 @@ obj-$(CONFIG_HAVE_BLOCK_DEVICE) += blk_common.o obj-$(CONFIG_CMD_SOURCE) += source.o obj-$(CONFIG_CMD_BCB) += bcb.o obj-$(CONFIG_CMD_BDI) += bdinfo.o -obj-$(CONFIG_CMD_BEDBUG) += bedbug.o obj-$(CONFIG_CMD_BIND) += bind.o obj-$(CONFIG_CMD_BINOP) += binop.o obj-$(CONFIG_CMD_BLOBLIST) += bloblist.o diff --git a/cmd/bedbug.c b/cmd/bedbug.c deleted file mode 100644 index 0bd67fcf47..0000000000 --- a/cmd/bedbug.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * BedBug Functions - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -extern void show_regs __P ((struct pt_regs *)); -extern int run_command __P ((const char *, int)); - -ulong dis_last_addr = 0; /* Last address disassembled */ -ulong dis_last_len = 20; /* Default disassembler length */ -CPU_DEBUG_CTX bug_ctx; /* Bedbug context structure */ - - -/* ====================================================================== - * U-Boot's puts function does not append a newline, so the bedbug stuff - * will use this for the output of the dis/assembler. - * ====================================================================== */ - -int bedbug_puts (const char *str) -{ - /* -------------------------------------------------- */ - - printf ("%s\r\n", str); - return 0; -} /* bedbug_puts */ - - -/* ====================================================================== - * Initialize the bug_ctx structure used by the bedbug debugger. This is - * specific to the CPU since each has different debug registers and - * settings. - * ====================================================================== */ - -int bedbug_init(void) -{ - /* -------------------------------------------------- */ - return 0; -} /* bedbug_init */ - - -/* ====================================================================== - * Entry point from the interpreter to the disassembler. Repeated calls - * will resume from the last disassembled address. - * ====================================================================== */ -int do_bedbug_dis(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - ulong addr; /* Address to start disassembly from */ - ulong len; /* # of instructions to disassemble */ - - /* -------------------------------------------------- */ - - /* Setup to go from the last address if none is given */ - addr = dis_last_addr; - len = dis_last_len; - - if (argc < 2) - return CMD_RET_USAGE; - - if ((flag & CMD_FLAG_REPEAT) == 0) { - /* New command */ - addr = hextoul(argv[1], NULL); - - /* If an extra param is given then it is the length */ - if (argc > 2) - len = hextoul(argv[2], NULL); - } - - /* Run the disassembler */ - disppc ((unsigned char *) addr, 0, len, bedbug_puts, F_RADHEX); - - dis_last_addr = addr + (len * 4); - dis_last_len = len; - return 0; -} /* do_bedbug_dis */ - -U_BOOT_CMD (ds, 3, 1, do_bedbug_dis, - "disassemble memory", - "ds
[# instructions]"); - -/* ====================================================================== - * Entry point from the interpreter to the assembler. Assembles - * instructions in consecutive memory locations until a '.' (period) is - * entered on a line by itself. - * ====================================================================== */ -int do_bedbug_asm(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - long mem_addr; /* Address to assemble into */ - unsigned long instr; /* Machine code for text */ - char prompt[15]; /* Prompt string for user input */ - int asm_err; /* Error code from the assembler */ - - /* -------------------------------------------------- */ - int rcode = 0; - - if (argc < 2) - return CMD_RET_USAGE; - - printf ("\nEnter '.' when done\n"); - mem_addr = hextoul(argv[1], NULL); - - while (1) { - putc ('\n'); - disppc ((unsigned char *) mem_addr, 0, 1, bedbug_puts, - F_RADHEX); - - sprintf (prompt, "%08lx: ", mem_addr); - cli_readline(prompt); - - if (console_buffer[0] && strcmp (console_buffer, ".")) { - if ((instr = - asmppc (mem_addr, console_buffer, - &asm_err)) != 0) { - *(unsigned long *) mem_addr = instr; - mem_addr += 4; - } else { - printf ("*** Error: %s ***\n", - asm_error_str (asm_err)); - rcode = 1; - } - } else { - break; - } - } - return rcode; -} /* do_bedbug_asm */ - -U_BOOT_CMD (as, 2, 0, do_bedbug_asm, - "assemble memory", "as
"); - -/* ====================================================================== - * Used to set a break point from the interpreter. Simply calls into the - * CPU-specific break point set routine. - * ====================================================================== */ - -int do_bedbug_break(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - /* -------------------------------------------------- */ - if (bug_ctx.do_break) - (*bug_ctx.do_break) (cmdtp, flag, argc, argv); - return 0; - -} /* do_bedbug_break */ - -U_BOOT_CMD (break, 3, 0, do_bedbug_break, - "set or clear a breakpoint", - " - Set or clear a breakpoint\n" - "break
- Break at an address\n" - "break off - Disable breakpoint.\n" - "break show - List breakpoints."); - -/* ====================================================================== - * Called from the debug interrupt routine. Simply calls the CPU-specific - * breakpoint handling routine. - * ====================================================================== */ - -void do_bedbug_breakpoint (struct pt_regs *regs) -{ - /* -------------------------------------------------- */ - - if (bug_ctx.break_isr) - (*bug_ctx.break_isr) (regs); - - return; -} /* do_bedbug_breakpoint */ - - -/* ====================================================================== - * Called from the CPU-specific breakpoint handling routine. Enter a - * mini main loop until the stopped flag is cleared from the breakpoint - * context. - * - * This handles the parts of the debugger that are common to all CPU's. - * ====================================================================== */ - -void bedbug_main_loop (unsigned long addr, struct pt_regs *regs) -{ - int len; /* Length of command line */ - int flag; /* Command flags */ - int rc = 0; /* Result from run_command */ - char prompt_str[20]; /* Prompt string */ - static char lastcommand[CONFIG_SYS_CBSIZE] = { 0 }; /* previous command */ - /* -------------------------------------------------- */ - - if (bug_ctx.clear) - (*bug_ctx.clear) (bug_ctx.current_bp); - - printf ("Breakpoint %d: ", bug_ctx.current_bp); - disppc ((unsigned char *) addr, 0, 1, bedbug_puts, F_RADHEX); - - bug_ctx.stopped = 1; - bug_ctx.regs = regs; - - sprintf (prompt_str, "BEDBUG.%d =>", bug_ctx.current_bp); - - /* A miniature main loop */ - while (bug_ctx.stopped) { - len = cli_readline(prompt_str); - - flag = 0; /* assume no special flags for now */ - - if (len > 0) - strcpy (lastcommand, console_buffer); - else if (len == 0) - flag |= CMD_FLAG_REPEAT; - - if (len == -1) - printf ("\n"); - else - rc = run_command_repeatable(lastcommand, flag); - - if (rc <= 0) { - /* invalid command or not repeatable, forget it */ - lastcommand[0] = 0; - } - } - - bug_ctx.regs = NULL; - bug_ctx.current_bp = 0; - - return; -} /* bedbug_main_loop */ - - -/* ====================================================================== - * Interpreter command to continue from a breakpoint. Just clears the - * stopped flag in the context so that the breakpoint routine will - * return. - * ====================================================================== */ -int do_bedbug_continue(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - /* -------------------------------------------------- */ - - if (!bug_ctx.stopped) { - printf ("Not at a breakpoint\n"); - return 1; - } - - bug_ctx.stopped = 0; - return 0; -} /* do_bedbug_continue */ - -U_BOOT_CMD (continue, 1, 0, do_bedbug_continue, - "continue from a breakpoint", - ""); - -/* ====================================================================== - * Interpreter command to continue to the next instruction, stepping into - * subroutines. Works by calling the find_next_addr() routine to compute - * the address passes control to the CPU-specific set breakpoint routine - * for the current breakpoint number. - * ====================================================================== */ -int do_bedbug_step(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - unsigned long addr; /* Address to stop at */ - - /* -------------------------------------------------- */ - - if (!bug_ctx.stopped) { - printf ("Not at a breakpoint\n"); - return 1; - } - - if (!find_next_address((unsigned char *) &addr, false, bug_ctx.regs)) - return 1; - - if (bug_ctx.set) - (*bug_ctx.set) (bug_ctx.current_bp, addr); - - bug_ctx.stopped = 0; - return 0; -} /* do_bedbug_step */ - -U_BOOT_CMD (step, 1, 1, do_bedbug_step, - "single step execution.", - ""); - -/* ====================================================================== - * Interpreter command to continue to the next instruction, stepping over - * subroutines. Works by calling the find_next_addr() routine to compute - * the address passes control to the CPU-specific set breakpoint routine - * for the current breakpoint number. - * ====================================================================== */ -int do_bedbug_next(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - unsigned long addr; /* Address to stop at */ - - /* -------------------------------------------------- */ - - if (!bug_ctx.stopped) { - printf ("Not at a breakpoint\n"); - return 1; - } - - if (!find_next_address((unsigned char *) &addr, true, bug_ctx.regs)) - return 1; - - if (bug_ctx.set) - (*bug_ctx.set) (bug_ctx.current_bp, addr); - - bug_ctx.stopped = 0; - return 0; -} /* do_bedbug_next */ - -U_BOOT_CMD (next, 1, 1, do_bedbug_next, - "single step execution, stepping over subroutines.", - ""); - -/* ====================================================================== - * Interpreter command to print the current stack. This assumes an EABI - * architecture, so it starts with GPR R1 and works back up the stack. - * ====================================================================== */ -int do_bedbug_stack(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - unsigned long sp; /* Stack pointer */ - unsigned long func; /* LR from stack */ - int depth; /* Stack iteration level */ - int skip = 1; /* Flag to skip the first entry */ - unsigned long top; /* Top of memory address */ - - /* -------------------------------------------------- */ - - if (!bug_ctx.stopped) { - printf ("Not at a breakpoint\n"); - return 1; - } - - top = gd->ram_start + gd->ram_size; - depth = 0; - - printf ("Depth PC\n"); - printf ("----- --------\n"); - printf ("%5d %08lx\n", depth++, bug_ctx.regs->nip); - - sp = bug_ctx.regs->gpr[1]; - func = *(unsigned long *) (sp + 4); - - while ((func < top) && (sp < top)) { - if (!skip) - printf ("%5d %08lx\n", depth++, func); - else - --skip; - - sp = *(unsigned long *) sp; - func = *(unsigned long *) (sp + 4); - } - return 0; -} /* do_bedbug_stack */ - -U_BOOT_CMD (where, 1, 1, do_bedbug_stack, - "Print the running stack.", - ""); - -/* ====================================================================== - * Interpreter command to dump the registers. Calls the CPU-specific - * show registers routine. - * ====================================================================== */ -int do_bedbug_rdump(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - /* -------------------------------------------------- */ - - if (!bug_ctx.stopped) { - printf ("Not at a breakpoint\n"); - return 1; - } - - show_regs (bug_ctx.regs); - return 0; -} /* do_bedbug_rdump */ - -U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump, - "Show registers.", ""); -/* ====================================================================== */ - - -/* - * Copyright (c) 2001 William L. Pitts - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/common/Makefile b/common/Makefile index c500bcd7d8..2935a08b4f 100644 --- a/common/Makefile +++ b/common/Makefile @@ -17,7 +17,6 @@ obj-y += board_r.o obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o -obj-$(CONFIG_CMD_BEDBUG) += bedbug.o obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o obj-$(CONFIG_MII) += miiphyutil.o obj-$(CONFIG_CMD_MII) += miiphyutil.o diff --git a/common/bedbug.c b/common/bedbug.c deleted file mode 100644 index c76fa4898c..0000000000 --- a/common/bedbug.c +++ /dev/null @@ -1,1254 +0,0 @@ -/* $Id$ */ - -#include -#include - -#include -#include -#include -#include -#include - -#define Elf32_Word unsigned long - -/* USE_SOURCE_CODE enables some symbolic debugging functions of this - code. This is only useful if the program will have access to the - source code for the binary being examined. -*/ - -/* #define USE_SOURCE_CODE 1 */ - -#ifdef USE_SOURCE_CODE -extern int line_info_from_addr __P ((Elf32_Word, char *, char *, int *)); -extern struct symreflist *symByAddr; -extern char *symbol_name_from_addr __P ((Elf32_Word, int, int *)); -#endif /* USE_SOURCE_CODE */ - -int print_operands __P ((struct ppc_ctx *)); -int get_operand_value __P ((struct opcode *, unsigned long, - enum OP_FIELD, unsigned long *)); -struct opcode *find_opcode __P ((unsigned long)); -struct opcode *find_opcode_by_name __P ((char *)); -char *spr_name __P ((int)); -int spr_value __P ((char *)); -char *tbr_name __P ((int)); -int tbr_value __P ((char *)); -int parse_operand __P ((unsigned long, struct opcode *, - struct operand *, char *, int *)); -int get_word __P ((char **, char *)); -long read_number __P ((char *)); -int downstring __P ((char *)); - - -/*====================================================================== - * Entry point for the PPC disassembler. - * - * Arguments: - * memaddr The address to start disassembling from. - * - * virtual If this value is non-zero, then this will be - * used as the base address for the output and - * symbol lookups. If this value is zero then - * memaddr is used as the absolute address. - * - * num_instr The number of instructions to disassemble. Since - * each instruction is 32 bits long, this can be - * computed if you know the total size of the region. - * - * pfunc The address of a function that is called to print - * each line of output. The function should take a - * single character pointer as its parameters a la puts. - * - * flags Sets options for the output. This is a - * bitwise-inclusive-OR of the following - * values. Note that only one of the radix - * options may be set. - * - * F_RADOCTAL - output radix is unsigned base 8. - * F_RADUDECIMAL - output radix is unsigned base 10. - * F_RADSDECIMAL - output radix is signed base 10. - * F_RADHEX - output radix is unsigned base 16. - * F_SIMPLE - use simplified mnemonics. - * F_SYMBOL - lookup symbols for addresses. - * F_INSTR - output raw instruction. - * F_LINENO - show line # info if available. - * - * Returns true if the area was successfully disassembled or false if - * a problem was encountered with accessing the memory. - */ - -int disppc (unsigned char *memaddr, unsigned char *virtual, int num_instr, - int (*pfunc) (const char *), unsigned long flags) -{ - int i; - struct ppc_ctx ctx; - -#ifdef USE_SOURCE_CODE - int line_no = 0; - int last_line_no = 0; - char funcname[128] = { 0 }; - char filename[256] = { 0 }; - char last_funcname[128] = { 0 }; - int symoffset; - char *symname; - char *cursym = (char *) 0; -#endif /* USE_SOURCE_CODE */ - /*------------------------------------------------------------*/ - - ctx.flags = flags; - ctx.virtual = virtual; - - /* Figure out the output radix before we go any further */ - - if (ctx.flags & F_RADOCTAL) { - /* Unsigned octal output */ - strcpy (ctx.radix_fmt, "O%o"); - } else if (ctx.flags & F_RADUDECIMAL) { - /* Unsigned decimal output */ - strcpy (ctx.radix_fmt, "%u"); - } else if (ctx.flags & F_RADSDECIMAL) { - /* Signed decimal output */ - strcpy (ctx.radix_fmt, "%d"); - } else { - /* Unsigned hex output */ - strcpy (ctx.radix_fmt, "0x%x"); - } - - if (ctx.virtual == 0) { - ctx.virtual = memaddr; - } -#ifdef USE_SOURCE_CODE - if (ctx.flags & F_SYMBOL) { - if (symByAddr == 0) /* no symbols loaded */ - ctx.flags &= ~F_SYMBOL; - else { - cursym = (char *) 0; - symoffset = 0; - } - } -#endif /* USE_SOURCE_CODE */ - - /* format each line as "XXXXXXXX: IIIIIIII disassembly" where, - XXXXXXXX is the memory address in hex, - is the symbolic location if F_SYMBOL is set. - IIIIIIII is the raw machine code in hex if F_INSTR is set, - and disassembly is the disassembled machine code with numbers - formatted according to the 'radix' parameter */ - - for (i = 0; i < num_instr; ++i, memaddr += 4, ctx.virtual += 4) { -#ifdef USE_SOURCE_CODE - if (ctx.flags & F_LINENO) { - if ((line_info_from_addr ((Elf32_Word) ctx.virtual, - filename, funcname, &line_no) == true) && - ((line_no != last_line_no) || - (strcmp (last_funcname, funcname) != 0))) { - print_source_line (filename, funcname, line_no, pfunc); - } - last_line_no = line_no; - strcpy (last_funcname, funcname); - } -#endif /* USE_SOURCE_CODE */ - - sprintf (ctx.data, "%08lx: ", (unsigned long) ctx.virtual); - ctx.datalen = 10; - -#ifdef USE_SOURCE_CODE - if (ctx.flags & F_SYMBOL) { - if ((symname = - symbol_name_from_addr((Elf32_Word) ctx.virtual, - true, 0)) != 0) { - cursym = symname; - symoffset = 0; - } else { - if ((cursym == 0) && - ((symname = - symbol_name_from_addr((Elf32_Word) ctx.virtual, - false, &symoffset)) != 0)) { - cursym = symname; - } else { - symoffset += 4; - } - } - - if (cursym != 0) { - sprintf (&ctx.data[ctx.datalen], "<%s+", cursym); - ctx.datalen = strlen (ctx.data); - sprintf (&ctx.data[ctx.datalen], ctx.radix_fmt, symoffset); - strcat (ctx.data, ">"); - ctx.datalen = strlen (ctx.data); - } - } -#endif /* USE_SOURCE_CODE */ - - ctx.instr = INSTRUCTION (memaddr); - - if (ctx.flags & F_INSTR) { - /* Find the opcode structure for this opcode. If one is not found - then it must be an illegal instruction */ - sprintf (&ctx.data[ctx.datalen], - " %02lx %02lx %02lx %02lx ", - ((ctx.instr >> 24) & 0xff), - ((ctx.instr >> 16) & 0xff), ((ctx.instr >> 8) & 0xff), - (ctx.instr & 0xff)); - ctx.datalen += 18; - } else { - strcat (ctx.data, " "); - ctx.datalen += 3; - } - - if ((ctx.op = find_opcode (ctx.instr)) == 0) { - /* Illegal Opcode */ - sprintf (&ctx.data[ctx.datalen], " .long 0x%08lx", - ctx.instr); - ctx.datalen += 24; - (*pfunc) (ctx.data); - continue; - } - - if (((ctx.flags & F_SIMPLE) == 0) || - (ctx.op->hfunc == 0) || - ((*ctx.op->hfunc) (&ctx) == false)) { - sprintf (&ctx.data[ctx.datalen], "%-7s ", ctx.op->name); - ctx.datalen += 8; - print_operands (&ctx); - } - - (*pfunc) (ctx.data); - } - - return true; -} /* disppc */ - - - -/*====================================================================== - * Called by the disassembler to print the operands for an instruction. - * - * Arguments: - * ctx A pointer to the disassembler context record. - * - * always returns 0. - */ - -int print_operands (struct ppc_ctx *ctx) -{ - int open_parens = 0; - int field; - unsigned long operand; - struct operand *opr; - -#ifdef USE_SOURCE_CODE - char *symname; - int offset; -#endif /* USE_SOURCE_CODE */ - /*------------------------------------------------------------*/ - - /* Walk through the operands and list each in order */ - for (field = 0; ctx->op->fields[field] != 0; ++field) { - if (ctx->op->fields[field] > n_operands) { - continue; /* bad operand ?! */ - } - - opr = &operands[ctx->op->fields[field] - 1]; - - if (opr->hint & OH_SILENT) { - continue; - } - - if ((field > 0) && !open_parens) { - strcat (ctx->data, ","); - ctx->datalen++; - } - - operand = (ctx->instr >> opr->shift) & ((1 << opr->bits) - 1); - - if (opr->hint & OH_ADDR) { - if ((operand & (1 << (opr->bits - 1))) != 0) { - operand = operand - (1 << opr->bits); - } - - if (ctx->op->hint & H_RELATIVE) - operand = (operand << 2) + (unsigned long) ctx->virtual; - else - operand = (operand << 2); - - - sprintf (&ctx->data[ctx->datalen], "0x%lx", operand); - ctx->datalen = strlen (ctx->data); - -#ifdef USE_SOURCE_CODE - if ((ctx->flags & F_SYMBOL) && - ((symname = - symbol_name_from_addr (operand, 0, &offset)) != 0)) { - sprintf (&ctx->data[ctx->datalen], " <%s", symname); - if (offset != 0) { - strcat (ctx->data, "+"); - ctx->datalen = strlen (ctx->data); - sprintf (&ctx->data[ctx->datalen], ctx->radix_fmt, - offset); - } - strcat (ctx->data, ">"); - } -#endif /* USE_SOURCE_CODE */ - } - - else if (opr->hint & OH_REG) { - if ((operand == 0) && - (opr->field == O_rA) && (ctx->op->hint & H_RA0_IS_0)) { - strcat (ctx->data, "0"); - } else { - sprintf (&ctx->data[ctx->datalen], "r%d", (short) operand); - } - - if (open_parens) { - strcat (ctx->data, ")"); - open_parens--; - } - } - - else if (opr->hint & OH_SPR) { - strcat (ctx->data, spr_name (operand)); - } - - else if (opr->hint & OH_TBR) { - strcat (ctx->data, tbr_name (operand)); - } - - else if (opr->hint & OH_LITERAL) { - switch (opr->field) { - case O_cr2: - strcat (ctx->data, "cr2"); - ctx->datalen += 3; - break; - - default: - break; - } - } - - else { - sprintf (&ctx->data[ctx->datalen], ctx->radix_fmt, - (unsigned short) operand); - - if (open_parens) { - strcat (ctx->data, ")"); - open_parens--; - } - - else if (opr->hint & OH_OFFSET) { - strcat (ctx->data, "("); - open_parens++; - } - } - - ctx->datalen = strlen (ctx->data); - } - - return 0; -} /* print_operands */ - - - -/*====================================================================== - * Called to get the value of an arbitrary operand with in an instruction. - * - * Arguments: - * op The pointer to the opcode structure to which - * the operands belong. - * - * instr The instruction (32 bits) containing the opcode - * and the operands to print. By the time that - * this routine is called the operand has already - * been added to the output. - * - * field The field (operand) to get the value of. - * - * value The address of an unsigned long to be filled in - * with the value of the operand if it is found. This - * will only be filled in if the function returns - * true. This may be passed as 0 if the value is - * not required. - * - * Returns true if the operand was found or false if it was not. - */ - -int get_operand_value (struct opcode *op, unsigned long instr, - enum OP_FIELD field, unsigned long *value) -{ - int i; - struct operand *opr; - - /*------------------------------------------------------------*/ - - if (field > n_operands) { - return false; /* bad operand ?! */ - } - - /* Walk through the operands and list each in order */ - for (i = 0; op->fields[i] != 0; ++i) { - if (op->fields[i] != field) { - continue; - } - - opr = &operands[op->fields[i] - 1]; - - if (value) { - *value = (instr >> opr->shift) & ((1 << opr->bits) - 1); - } - return true; - } - - return false; -} /* operand_value */ - - - -/*====================================================================== - * Called by the disassembler to match an opcode value to an opcode structure. - * - * Arguments: - * instr The instruction (32 bits) to match. This value - * may contain operand values as well as the opcode - * since they will be masked out anyway for this - * search. - * - * Returns the address of an opcode struct (from the opcode table) if the - * operand successfully matched an entry, or 0 if no match was found. - */ - -struct opcode *find_opcode (unsigned long instr) -{ - struct opcode *ptr; - int top = 0; - int bottom = n_opcodes - 1; - int idx; - - /*------------------------------------------------------------*/ - - while (top <= bottom) { - idx = (top + bottom) >> 1; - ptr = &opcodes[idx]; - - if ((instr & ptr->mask) < ptr->opcode) { - bottom = idx - 1; - } else if ((instr & ptr->mask) > ptr->opcode) { - top = idx + 1; - } else { - return ptr; - } - } - - return (struct opcode *) 0; -} /* find_opcode */ - - - -/*====================================================================== - * Called by the assembler to match an opcode name to an opcode structure. - * - * Arguments: - * name The text name of the opcode, e.g. "b", "mtspr", etc. - * - * The opcodes are sorted numerically by their instruction binary code - * so a search for the name cannot use the binary search used by the - * other find routine. - * - * Returns the address of an opcode struct (from the opcode table) if the - * name successfully matched an entry, or 0 if no match was found. - */ - -struct opcode *find_opcode_by_name (char *name) -{ - int idx; - - /*------------------------------------------------------------*/ - - downstring (name); - - for (idx = 0; idx < n_opcodes; ++idx) { - if (!strcmp (name, opcodes[idx].name)) - return &opcodes[idx]; - } - - return (struct opcode *) 0; -} /* find_opcode_by_name */ - - - -/*====================================================================== - * Convert the 'spr' operand from its numeric value to its symbolic name. - * - * Arguments: - * value The value of the 'spr' operand. This value should - * be unmodified from its encoding in the instruction. - * the split-field computations will be performed - * here before the switch. - * - * Returns the address of a character array containing the name of the - * special purpose register defined by the 'value' parameter, or the - * address of a character array containing "???" if no match was found. - */ - -char *spr_name (int value) -{ - unsigned short spr; - static char other[10]; - int i; - - /*------------------------------------------------------------*/ - - /* spr is a 10 bit field whose interpretation has the high and low - five-bit fields reversed from their encoding in the operand */ - - spr = ((value >> 5) & 0x1f) | ((value & 0x1f) << 5); - - for (i = 0; i < n_sprs; ++i) { - if (spr == spr_map[i].spr_val) - return spr_map[i].spr_name; - } - - sprintf (other, "%d", spr); - return other; -} /* spr_name */ - - - -/*====================================================================== - * Convert the 'spr' operand from its symbolic name to its numeric value - * - * Arguments: - * name The symbolic name of the 'spr' operand. The - * split-field encoding will be done by this routine. - * NOTE: name can be a number. - * - * Returns the numeric value for the spr appropriate for encoding a machine - * instruction. Returns 0 if unable to find the SPR. - */ - -int spr_value (char *name) -{ - struct spr_info *sprp; - int spr; - int i; - - /*------------------------------------------------------------*/ - - if (!name || !*name) - return 0; - - if (isdigit ((int) name[0])) { - i = htonl (read_number (name)); - spr = ((i >> 5) & 0x1f) | ((i & 0x1f) << 5); - return spr; - } - - downstring (name); - - for (i = 0; i < n_sprs; ++i) { - sprp = &spr_map[i]; - - if (strcmp (name, sprp->spr_name) == 0) { - /* spr is a 10 bit field whose interpretation has the high and low - five-bit fields reversed from their encoding in the operand */ - i = htonl (sprp->spr_val); - spr = ((i >> 5) & 0x1f) | ((i & 0x1f) << 5); - - return spr; - } - } - - return 0; -} /* spr_value */ - - - -/*====================================================================== - * Convert the 'tbr' operand from its numeric value to its symbolic name. - * - * Arguments: - * value The value of the 'tbr' operand. This value should - * be unmodified from its encoding in the instruction. - * the split-field computations will be performed - * here before the switch. - * - * Returns the address of a character array containing the name of the - * time base register defined by the 'value' parameter, or the address - * of a character array containing "???" if no match was found. - */ - -char *tbr_name (int value) -{ - unsigned short tbr; - - /*------------------------------------------------------------*/ - - /* tbr is a 10 bit field whose interpretation has the high and low - five-bit fields reversed from their encoding in the operand */ - - tbr = ((value >> 5) & 0x1f) | ((value & 0x1f) << 5); - - if (tbr == 268) - return "TBL"; - - else if (tbr == 269) - return "TBU"; - - - return "???"; -} /* tbr_name */ - - - -/*====================================================================== - * Convert the 'tbr' operand from its symbolic name to its numeric value. - * - * Arguments: - * name The symbolic name of the 'tbr' operand. The - * split-field encoding will be done by this routine. - * - * Returns the numeric value for the spr appropriate for encoding a machine - * instruction. Returns 0 if unable to find the TBR. - */ - -int tbr_value (char *name) -{ - int tbr; - int val; - - /*------------------------------------------------------------*/ - - if (!name || !*name) - return 0; - - downstring (name); - - if (isdigit ((int) name[0])) { - val = read_number (name); - - if (val != 268 && val != 269) - return 0; - } else if (strcmp (name, "tbl") == 0) - val = 268; - else if (strcmp (name, "tbu") == 0) - val = 269; - else - return 0; - - /* tbr is a 10 bit field whose interpretation has the high and low - five-bit fields reversed from their encoding in the operand */ - - val = htonl (val); - tbr = ((val >> 5) & 0x1f) | ((val & 0x1f) << 5); - return tbr; -} /* tbr_name */ - - - -/*====================================================================== - * The next several functions (handle_xxx) are the routines that handle - * disassembling the opcodes with simplified mnemonics. - * - * Arguments: - * ctx A pointer to the disassembler context record. - * - * Returns true if the simpler form was printed or false if it was not. - */ - -int handle_bc (struct ppc_ctx *ctx) -{ - unsigned long bo; - unsigned long bi; - static struct opcode blt = { B_OPCODE (16, 0, 0), B_MASK, {O_BD, 0}, - 0, "blt", H_RELATIVE - }; - static struct opcode bne = - { B_OPCODE (16, 0, 0), B_MASK, {O_cr2, O_BD, 0}, - 0, "bne", H_RELATIVE - }; - static struct opcode bdnz = { B_OPCODE (16, 0, 0), B_MASK, {O_BD, 0}, - 0, "bdnz", H_RELATIVE - }; - - /*------------------------------------------------------------*/ - - if (get_operand_value(ctx->op, ctx->instr, O_BO, &bo) == false) - return false; - - if (get_operand_value(ctx->op, ctx->instr, O_BI, &bi) == false) - return false; - - if ((bo == 12) && (bi == 0)) { - ctx->op = &blt; - sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name); - ctx->datalen += 8; - print_operands (ctx); - return true; - } else if ((bo == 4) && (bi == 10)) { - ctx->op = =⃥ - sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name); - ctx->datalen += 8; - print_operands (ctx); - return true; - } else if ((bo == 16) && (bi == 0)) { - ctx->op = &bdnz; - sprintf (&ctx->data[ctx->datalen], "%-7s ", ctx->op->name); - ctx->datalen += 8; - print_operands (ctx); - return true; - } - - return false; -} /* handle_blt */ - - - -/*====================================================================== - * Outputs source line information for the disassembler. This should - * be modified in the future to lookup the actual line of source code - * from the file, but for now this will do. - * - * Arguments: - * filename The address of a character array containing the - * absolute path and file name of the source file. - * - * funcname The address of a character array containing the - * name of the function (not C++ demangled (yet)) - * to which this code belongs. - * - * line_no An integer specifying the source line number that - * generated this code. - * - * pfunc The address of a function to call to print the output. - * - * - * Returns true if it was able to output the line info, or false if it was - * not. - */ - -int print_source_line (char *filename, char *funcname, - int line_no, int (*pfunc) (const char *)) -{ - char out_buf[256]; - - /*------------------------------------------------------------*/ - - (*pfunc) (""); /* output a newline */ - sprintf (out_buf, "%s %s(): line %d", filename, funcname, line_no); - (*pfunc) (out_buf); - - return true; -} /* print_source_line */ - - - -/*====================================================================== - * Entry point for the PPC assembler. - * - * Arguments: - * asm_buf An array of characters containing the assembly opcode - * and operands to convert to a POWERPC machine - * instruction. - * - * Returns the machine instruction or zero. - */ - -unsigned long asmppc (unsigned long memaddr, char *asm_buf, int *err) -{ - struct opcode *opc; - struct operand *oper[MAX_OPERANDS]; - unsigned long instr; - unsigned long param; - char *ptr = asm_buf; - char scratch[20]; - int i; - int w_operands = 0; /* wanted # of operands */ - int n_operands = 0; /* # of operands read */ - int asm_debug = 0; - - /*------------------------------------------------------------*/ - - if (err) - *err = 0; - - if (get_word (&ptr, scratch) == 0) - return 0; - - /* Lookup the opcode structure based on the opcode name */ - if ((opc = find_opcode_by_name (scratch)) == (struct opcode *) 0) { - if (err) - *err = E_ASM_BAD_OPCODE; - return 0; - } - - if (asm_debug) { - printf ("asmppc: Opcode = \"%s\"\n", opc->name); - } - - for (i = 0; i < 8; ++i) { - if (opc->fields[i] == 0) - break; - ++w_operands; - } - - if (asm_debug) { - printf ("asmppc: Expecting %d operands\n", w_operands); - } - - instr = opc->opcode; - - /* read each operand */ - while (n_operands < w_operands) { - - oper[n_operands] = &operands[opc->fields[n_operands] - 1]; - - if (oper[n_operands]->hint & OH_SILENT) { - /* Skip silent operands, they are covered in opc->opcode */ - - if (asm_debug) { - printf ("asmppc: Operand %d \"%s\" SILENT\n", n_operands, - oper[n_operands]->name); - } - - ++n_operands; - continue; - } - - if (get_word (&ptr, scratch) == 0) - break; - - if (asm_debug) { - printf ("asmppc: Operand %d \"%s\" : \"%s\"\n", n_operands, - oper[n_operands]->name, scratch); - } - - if ((param = parse_operand (memaddr, opc, oper[n_operands], - scratch, err)) == -1) - return 0; - - instr |= param; - ++n_operands; - } - - if (n_operands < w_operands) { - if (err) - *err = E_ASM_NUM_OPERANDS; - return 0; - } - - if (asm_debug) { - printf ("asmppc: Instruction = 0x%08lx\n", instr); - } - - return instr; -} /* asmppc */ - - - -/*====================================================================== - * Called by the assembler to interpret a single operand - * - * Arguments: - * ctx A pointer to the disassembler context record. - * - * Returns 0 if the operand is ok, or -1 if it is bad. - */ - -int parse_operand (unsigned long memaddr, struct opcode *opc, - struct operand *oper, char *txt, int *err) -{ - long data; - long mask; - int is_neg = 0; - - /*------------------------------------------------------------*/ - - mask = (1 << oper->bits) - 1; - - if (oper->hint & OH_ADDR) { - data = read_number (txt); - - if (opc->hint & H_RELATIVE) - data = data - memaddr; - - if (data < 0) - is_neg = 1; - - data >>= 2; - data &= (mask >> 1); - - if (is_neg) - data |= 1 << (oper->bits - 1); - } - - else if (oper->hint & OH_REG) { - if (txt[0] == 'r' || txt[0] == 'R') - txt++; - else if (txt[0] == '%' && (txt[1] == 'r' || txt[1] == 'R')) - txt += 2; - - data = read_number (txt); - if (data > 31) { - if (err) - *err = E_ASM_BAD_REGISTER; - return -1; - } - - data = htonl (data); - } - - else if (oper->hint & OH_SPR) { - if ((data = spr_value (txt)) == 0) { - if (err) - *err = E_ASM_BAD_SPR; - return -1; - } - } - - else if (oper->hint & OH_TBR) { - if ((data = tbr_value (txt)) == 0) { - if (err) - *err = E_ASM_BAD_TBR; - return -1; - } - } - - else { - data = htonl (read_number (txt)); - } - - return (data & mask) << oper->shift; -} /* parse_operand */ - - -char *asm_error_str (int err) -{ - switch (err) { - case E_ASM_BAD_OPCODE: - return "Bad opcode"; - case E_ASM_NUM_OPERANDS: - return "Bad number of operands"; - case E_ASM_BAD_REGISTER: - return "Bad register number"; - case E_ASM_BAD_SPR: - return "Bad SPR name or number"; - case E_ASM_BAD_TBR: - return "Bad TBR name or number"; - } - - return ""; -} /* asm_error_str */ - - - -/*====================================================================== - * Copy a word from one buffer to another, ignores leading white spaces. - * - * Arguments: - * src The address of a character pointer to the - * source buffer. - * dest A pointer to a character buffer to write the word - * into. - * - * Returns the number of non-white space characters copied, or zero. - */ - -int get_word (char **src, char *dest) -{ - char *ptr = *src; - int nchars = 0; - - /*------------------------------------------------------------*/ - - /* Eat white spaces */ - while (*ptr && isblank (*ptr)) - ptr++; - - if (*ptr == 0) { - *src = ptr; - return 0; - } - - /* Find the text of the word */ - while (*ptr && !isblank (*ptr) && (*ptr != ',')) - dest[nchars++] = *ptr++; - ptr = (*ptr == ',') ? ptr + 1 : ptr; - dest[nchars] = 0; - - *src = ptr; - return nchars; -} /* get_word */ - - - -/*====================================================================== - * Convert a numeric string to a number, be aware of base notations. - * - * Arguments: - * txt The numeric string. - * - * Returns the converted numeric value. - */ - -long read_number (char *txt) -{ - long val; - int is_neg = 0; - - /*------------------------------------------------------------*/ - - if (txt == 0 || *txt == 0) - return 0; - - if (*txt == '-') { - is_neg = 1; - ++txt; - } - - if (txt[0] == '0' && (txt[1] == 'x' || txt[1] == 'X')) /* hex */ - val = hextoul(&txt[2], NULL); - else /* decimal */ - val = dectoul(txt, NULL); - - if (is_neg) - val = -val; - - return val; -} /* read_number */ - - -int downstring (char *s) -{ - if (!s || !*s) - return 0; - - while (*s) { - if (isupper (*s)) - *s = tolower (*s); - s++; - } - - return 0; -} /* downstring */ - - - -/*====================================================================== - * Examines the instruction at the current address and determines the - * next address to be executed. This will take into account branches - * of different types so that a "step" and "next" operations can be - * supported. - * - * Arguments: - * nextaddr The address (to be filled in) of the next - * instruction to execute. This will only be a valid - * address if true is returned. - * - * step_over A flag indicating how to compute addresses for - * branch statements: - * true = Step over the branch (next) - * false = step into the branch (step) - * - * Returns true if it was able to compute the address. Returns false if - * it has a problem reading the current instruction or one of the registers. - */ - -int find_next_address (unsigned char *nextaddr, int step_over, - struct pt_regs *regs) -{ - unsigned long pc; /* SRR0 register from PPC */ - unsigned long ctr; /* CTR register from PPC */ - unsigned long cr; /* CR register from PPC */ - unsigned long lr; /* LR register from PPC */ - unsigned long instr; /* instruction at SRR0 */ - unsigned long next; /* computed instruction for 'next' */ - unsigned long step; /* computed instruction for 'step' */ - unsigned long addr = 0; /* target address operand */ - unsigned long aa = 0; /* AA operand */ - unsigned long lk = 0; /* LK operand */ - unsigned long bo = 0; /* BO operand */ - unsigned long bi = 0; /* BI operand */ - struct opcode *op = 0; /* opcode structure for 'instr' */ - int ctr_ok = 0; - int cond_ok = 0; - int conditional = 0; - int branch = 0; - - /*------------------------------------------------------------*/ - - if (nextaddr == 0 || regs == 0) { - printf ("find_next_address: bad args"); - return false; - } - - pc = regs->nip & 0xfffffffc; - instr = INSTRUCTION (pc); - - if ((op = find_opcode (instr)) == (struct opcode *) 0) { - printf ("find_next_address: can't parse opcode 0x%lx", instr); - return false; - } - - ctr = regs->ctr; - cr = regs->ccr; - lr = regs->link; - - switch (op->opcode) { - case B_OPCODE (16, 0, 0): /* bc */ - case B_OPCODE (16, 0, 1): /* bcl */ - case B_OPCODE (16, 1, 0): /* bca */ - case B_OPCODE (16, 1, 1): /* bcla */ - if (!get_operand_value (op, instr, O_BD, &addr) || - !get_operand_value (op, instr, O_BO, &bo) || - !get_operand_value (op, instr, O_BI, &bi) || - !get_operand_value (op, instr, O_AA, &aa) || - !get_operand_value (op, instr, O_LK, &lk)) - return false; - - if ((addr & (1 << 13)) != 0) - addr = addr - (1 << 14); - addr <<= 2; - conditional = 1; - branch = 1; - break; - - case I_OPCODE (18, 0, 0): /* b */ - case I_OPCODE (18, 0, 1): /* bl */ - case I_OPCODE (18, 1, 0): /* ba */ - case I_OPCODE (18, 1, 1): /* bla */ - if (!get_operand_value (op, instr, O_LI, &addr) || - !get_operand_value (op, instr, O_AA, &aa) || - !get_operand_value (op, instr, O_LK, &lk)) - return false; - - if ((addr & (1 << 23)) != 0) - addr = addr - (1 << 24); - addr <<= 2; - conditional = 0; - branch = 1; - break; - - case XL_OPCODE (19, 528, 0): /* bcctr */ - case XL_OPCODE (19, 528, 1): /* bcctrl */ - if (!get_operand_value (op, instr, O_BO, &bo) || - !get_operand_value (op, instr, O_BI, &bi) || - !get_operand_value (op, instr, O_LK, &lk)) - return false; - - addr = ctr; - aa = 1; - conditional = 1; - branch = 1; - break; - - case XL_OPCODE (19, 16, 0): /* bclr */ - case XL_OPCODE (19, 16, 1): /* bclrl */ - if (!get_operand_value (op, instr, O_BO, &bo) || - !get_operand_value (op, instr, O_BI, &bi) || - !get_operand_value (op, instr, O_LK, &lk)) - return false; - - addr = lr; - aa = 1; - conditional = 1; - branch = 1; - break; - - default: - conditional = 0; - branch = 0; - break; - } - - if (conditional) { - switch ((bo & 0x1e) >> 1) { - case 0: /* 0000y */ - if (--ctr != 0) - ctr_ok = 1; - - cond_ok = !(cr & (1 << (31 - bi))); - break; - - case 1: /* 0001y */ - if (--ctr == 0) - ctr_ok = 1; - - cond_ok = !(cr & (1 << (31 - bi))); - break; - - case 2: /* 001zy */ - ctr_ok = 1; - cond_ok = !(cr & (1 << (31 - bi))); - break; - - case 4: /* 0100y */ - if (--ctr != 0) - ctr_ok = 1; - - cond_ok = cr & (1 << (31 - bi)); - break; - - case 5: /* 0101y */ - if (--ctr == 0) - ctr_ok = 1; - - cond_ok = cr & (1 << (31 - bi)); - break; - - case 6: /* 011zy */ - ctr_ok = 1; - cond_ok = cr & (1 << (31 - bi)); - break; - - case 8: /* 1z00y */ - if (--ctr != 0) - ctr_ok = cond_ok = 1; - break; - - case 9: /* 1z01y */ - if (--ctr == 0) - ctr_ok = cond_ok = 1; - break; - - case 10: /* 1z1zz */ - ctr_ok = cond_ok = 1; - break; - } - } - - if (branch && (!conditional || (ctr_ok && cond_ok))) { - if (aa) - step = addr; - else - step = addr + pc; - - if (lk) - next = pc + 4; - else - next = step; - } else { - step = next = pc + 4; - } - - if (step_over == true) - *(unsigned long *) nextaddr = next; - else - *(unsigned long *) nextaddr = step; - - return true; -} /* find_next_address */ - - -/* - * Copyright (c) 2000 William L. Pitts and W. Gerald Hicks - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/common/board_r.c b/common/board_r.c index 31a59c585a..cc0e6fa92e 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -23,10 +23,6 @@ #include #include #include -/* TODO: can we just include all these headers whether needed or not? */ -#if defined(CONFIG_CMD_BEDBUG) -#include -#endif #include #include #include @@ -37,6 +33,7 @@ #include #include #include +/* TODO: can we just include all these headers whether needed or not? */ #if defined(CONFIG_CMD_KGDB) #include #endif @@ -796,10 +793,6 @@ static init_fnc_t init_sequence_r[] = { */ last_stage_init, #endif -#ifdef CONFIG_CMD_BEDBUG - INIT_FUNC_WATCHDOG_RESET - bedbug_init, -#endif #if defined(CONFIG_PRAM) initr_mem, #endif diff --git a/doc/README.bedbug b/doc/README.bedbug deleted file mode 100644 index 1a2acd0f14..0000000000 --- a/doc/README.bedbug +++ /dev/null @@ -1,56 +0,0 @@ -BEDBUG Support for U-Boot --------------------------- - -These changes implement the bedbug (emBEDded deBUGger) debugger in U-Boot. - -##################### -### Modifications ### -##################### - -./common/Makefile - Included cmd_bedbug.c and bedbug.c in the Makefile. - -./common/board.c - Added call to initialize debugger on startup. - -./include/ppc_asm.tmpl - Added code to handle critical exceptions - -################# -### New Stuff ### -################# - -./include/bedbug/ppc.h -./include/bedbug/regs.h -./include/bedbug/bedbug.h -./include/bedbug/elf.h [obsoleted by new include/elf.h] -./include/bedbug/tables.h -./include/cmd_bedbug.h -./common/cmd_bedbug.c -./common/bedbug.c - Bedbug library includes code for assembling and disassembling - PowerPC instructions to/from memory as well as handling - hardware breakpoints and stepping through code. These - routines are common to all PowerPC processors. - -Bedbug support for the MPC860 ------------------------------ - -Changes: - - common/cmd_bedbug.c - Added call to initialize 860 debugger. - - arch/powerpc/cpu/mpc8xx/Makefile - Added new file "bedbug_860.c" to the makefile - - arch/powerpc/cpu/mpc8xx/start.S - Added handler for InstructionBreakpoint (0xfd00) - - arch/powerpc/cpu/mpc8xx/traps.c - Added new routine DebugException() - -New Files: - - arch/powerpc/cpu/mpc8xx/bedbug_860.c - CPU-specific routines for 860 debug registers. diff --git a/include/bedbug/bedbug.h b/include/bedbug/bedbug.h deleted file mode 100644 index 0c5d687f83..0000000000 --- a/include/bedbug/bedbug.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ */ - -#ifndef _BEDBUG_H -#define _BEDBUG_H - -#ifndef NULL -#define NULL 0 -#endif - -#define _USE_PROTOTYPES - -#ifndef isblank -#define isblank(c) isspace((int)(c)) -#endif - -#ifndef __P -#if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus)) -#define __P(protos) protos /* full-blown ANSI C */ -#else -#define __P(protos) () /* traditional C preprocessor */ -#endif -#endif - -#endif /* _BEDBUG_H */ - - -/* - * Copyright (c) 2001 William L. Pitts - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/include/bedbug/ppc.h b/include/bedbug/ppc.h deleted file mode 100644 index 76d86fdbf7..0000000000 --- a/include/bedbug/ppc.h +++ /dev/null @@ -1,408 +0,0 @@ -/* $Id$ */ - -#ifndef _PPC_H -#define _PPC_H - -/*====================================================================== - * - * OPERANDS - * - *======================================================================*/ - -enum OP_FIELD { - O_AA = 1, O_BD, O_BI, O_BO, O_crbD, O_crbA, O_crbB, O_CRM, O_d, O_frC, O_frD, - O_frS, O_IMM, O_LI, O_LK, O_MB, O_ME, O_NB, O_OE, O_rA, O_rB, O_Rc, O_rD, - O_rS, O_SH, O_SIMM, O_SR, O_TO, O_UIMM, O_crfD, O_crfS, O_L, O_spr, O_tbr, - O_cr2 }; - -struct operand { - enum OP_FIELD field; /* The operand identifier from the - enum above */ - - char * name; /* Symbolic name of this operand */ - - unsigned int bits; /* The number of bits used by this - operand */ - - unsigned int shift; /* How far to the right the operand - should be shifted so that it is - aligned at the beginning of the - word */ - - unsigned int hint; /* A bitwise-inclusive-OR of the - values shown below. These are used - tell the disassembler how to print - this operand */ -}; - -/* Values for operand hint */ -#define OH_SILENT 0x01 /* dont print this operand */ -#define OH_ADDR 0x02 /* this operand is an address */ -#define OH_REG 0x04 /* this operand is a register */ -#define OH_SPR 0x08 /* this operand is an SPR */ -#define OH_TBR 0x10 /* this operand is a TBR */ -#define OH_OFFSET 0x20 /* this operand is an offset */ -#define OH_LITERAL 0x40 /* a literal string */ - - -/*====================================================================== - * - * OPCODES - * - *======================================================================*/ - -/* From the MPCxxx instruction set documentation, all instructions are - * 32 bits long and word aligned. Bits 0-5 always specify the primary - * opcode. Many instructions also have an extended opcode. - */ - -#define GET_OPCD(i) (((unsigned long)(i) >> 26) & 0x3f) -#define MAKE_OPCODE(i) ((((unsigned long)(i)) & 0x3f) << 26) - -/* The MPC860 User's Manual, Appendix D.4 contains the definitions of the - * instruction forms - */ - - -/*------------------------------------------------- - * I-Form Instructions: - * bX - *------------------------------------------------- - * OPCD | LI |AA|LK - *-------------------------------------------------*/ - -#define I_OPCODE(i,aa,lk) (MAKE_OPCODE(i) | (((aa) & 0x1) << 1) | ((lk) & 0x1)) -#define I_MASK I_OPCODE(0x3f,0x1,0x1) - - -/*------------------------------------------------- - * B-Form Instructions: - * bcX - *------------------------------------------------- - * OPCD | BO | BI | BD |AA|LK - *-------------------------------------------------*/ - -#define B_OPCODE(i,aa,lk) (MAKE_OPCODE(i) | (((aa) & 0x1) << 1) | ((lk) & 0x1)) -#define B_MASK B_OPCODE(0x3f,0x1,0x1) - - -/*------------------------------------------------- - * SC-Form Instructions: - * sc - *------------------------------------------------- - * OPCD | 00000 | 00000 | 00000000000000 |1|0 - *-------------------------------------------------*/ - -#define SC_OPCODE(i) (MAKE_OPCODE(i) | 0x2) -#define SC_MASK SC_OPCODE(0x3f) - - -/*------------------------------------------------- - * D-Form Instructions: - * addi addic addic. addis andi. andis. cmpi cmpli - * lbz lbzu lha lhau lhz lhzu lmw lwz lwzu mulli - * ori oris stb stbu sth sthu stmw stw stwu subfic - * twi xori xoris - *------------------------------------------------- - * OPCD | D | A | d - * OPCD | D | A | SIMM - * OPCD | S | A | d - * OPCD | S | A | UIMM - * OPCD |crfD|0|L| A | SIMM - * OPCD |crfD|0|L| A | UIMM - * OPCD | TO | A | SIMM - *-------------------------------------------------*/ - -#define D_OPCODE(i) MAKE_OPCODE(i) -#define D_MASK MAKE_OPCODE(0x3f) - - -/*------------------------------------------------- - * DS-Form Instructions: - * (none supported by MPC860) - *------------------------------------------------- - * OPCD | D | A | ds |XO - * OPCD | S | A | ds |XO - *-------------------------------------------------*/ - -#define DS_OPCODE(i,xo) (MAKE_OPCODE(i) | ((xo) & 0x3)) -#define DS_MASK DS_OPCODE(0x3f,0x1) - - -/*--------------------------------------------------- - * X-Form Instructions: - * andX andcX cmp cmpl cntlzwX dcbf dcbi dcbst dcbt - * dcbtst dcbz eciwx ecowx eieio eqvX extsbX extshX - * icbi lbzux lbxz lhaux lhax lhbrx lhzux lhxz lswi - * lswx lwarx lwbrx lwzux lwxz mcrfs mcrxr mfcr - * mfmsr mfsr mfsrin mtmsr mtsr mtsrin nandX norX - * orX orcX slwX srawX srawiX srwX stbux stbx - * sthbrx sthuxsthx stswi stswx stwbrx stwcx. stwux - * stwx sync tlbie tlbld tlbli tlbsync tw xorX - *--------------------------------------------------- - * OPCD | D | A | B | XO |0 - * OPCD | D | A | NB | XO |0 - * OPCD | D | 00000 | B | XO |0 - * OPCD | D | 00000 | 00000 | XO |0 - * OPCD | D |0| SR | 00000 | XO |0 - * OPCD | S | A | B | XO |Rc - * OPCD | S | A | B | XO |1 - * OPCD | S | A | B | XO |0 - * OPCD | S | A | NB | XO |0 - * OPCD | S | A | 00000 | XO |Rc - * OPCD | S | 00000 | B | XO |0 - * OPCD | S | 00000 | 00000 | XO |0 - * OPCD | S |0| SR | 00000 | XO |0 - * OPCD | S | A | SH | XO |Rc - * OPCD |crfD|0|L| A | SH | XO |0 - * OPCD |crfD |00| A | B | XO |0 - * OPCD |crfD |00|crfS |00| 00000 | XO |0 - * OPCD |crfD |00| 00000 | 00000 | XO |0 - * OPCD |crfD |00| 00000 | IMM |0| XO |Rc - * OPCD | TO | A | B | XO |0 - * OPCD | D | 00000 | B | XO |Rc - * OPCD | D | 00000 | 00000 | XO |Rc - * OPCD | crbD | 00000 | 00000 | XO |Rc - * OPCD | 00000 | A | B | XO |0 - * OPCD | 00000 | 00000 | B | XO |0 - * OPCD | 00000 | 00000 | 00000 | XO |0 - *---------------------------------------------------*/ - -#define X_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x3ff) << 1) | \ - ((rc) & 0x1)) -#define X_MASK X_OPCODE(0x3f,0x3ff,0x1) - - -/*--------------------------------------------------- - * XL-Form Instructions: - * bcctrX bclrX crand crandc creqv crnand crnor cror - * croc crxorisync mcrf rfi - *--------------------------------------------------- - * OPCD | BO | BI | 00000 | XO |LK - * OPCD | crbD | crbA | crbB | XO |0 - * OPCD |crfD |00|crfS |00| 00000 | XO |0 - * OPCD | 00000 | 00000 | 00000 | XO |0 - *---------------------------------------------------*/ - -#define XL_OPCODE(i,xo,lk) (MAKE_OPCODE(i) | (((xo) & 0x3ff) << 1) | \ - ((lk) & 0x1)) -#define XL_MASK XL_OPCODE(0x3f,0x3ff,0x1) - - -/*--------------------------------------------------- - * XFX-Form Instructions: - * mfspr mftb mtcrf mtspr - *--------------------------------------------------- - * OPCD | D | spr | XO |0 - * OPCD | D |0| CRM |0| XO |0 - * OPCD | S | spr | XO |0 - * OPCD | D | tbr | XO |0 - *---------------------------------------------------*/ - -#define XFX_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x3ff) << 1) | \ - ((rc) & 0x1)) -#define XFX_MASK XFX_OPCODE(0x3f,0x3ff,0x1) - - -/*--------------------------------------------------- - * XFL-Form Instructions: - * (none supported by MPC860) - *--------------------------------------------------- - * OPCD |0| FM |0| B | XO |0 - *---------------------------------------------------*/ - -#define XFL_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x3ff) << 1) | \ - ((rc) & 0x1)) -#define XFL_MASK XFL_OPCODE(0x3f,0x3ff,0x1) - - -/*--------------------------------------------------- - * XS-Form Instructions: - * (none supported by MPC860) - *--------------------------------------------------- - * OPCD | S | A | sh | XO |sh|LK - *---------------------------------------------------*/ - -#define XS_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x1ff) << 2) | \ - ((rc) & 0x1)) -#define XS_MASK XS_OPCODE(0x3f,0x1ff,0x1) - - -/*--------------------------------------------------- - * XO-Form Instructions: - * addX addcXaddeX addmeX addzeX divwX divwuX mulhwX - * mulhwuX mullwX negX subfX subfcX subfeX subfmeX - * subfzeX - *--------------------------------------------------- - * OPCD | D | A | B |OE| XO |Rc - * OPCD | D | A | B |0 | XO |Rc - * OPCD | D | A | 00000 |OE| XO |Rc - *---------------------------------------------------*/ - -#define XO_OPCODE(i,xo,oe,rc) (MAKE_OPCODE(i) | (((oe) & 0x1) << 10) | \ - (((xo) & 0x1ff) << 1) | ((rc) & 0x1)) -#define XO_MASK XO_OPCODE(0x3f,0x1ff,0x1,0x1) - - -/*--------------------------------------------------- - * A-Form Instructions: - * (none supported by MPC860) - *--------------------------------------------------- - * OPCD | D | A | B |00000| XO |Rc - * OPCD | D | A | B | C | XO |Rc - * OPCD | D | A | 00000 | C | XO |Rc - * OPCD | D | 00000 | B |00000| XO |Rc - *---------------------------------------------------*/ - -#define A_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x1f) << 1) | \ - ((rc) & 0x1)) -#define A_MASK A_OPCODE(0x3f,0x1f,0x1) - - -/*--------------------------------------------------- - * M-Form Instructions: - * rlwimiX rlwinmX rlwnmX - *--------------------------------------------------- - * OPCD | S | A | SH | MB | ME |Rc - * OPCD | S | A | B | MB | ME |Rc - *---------------------------------------------------*/ - -#define M_OPCODE(i,rc) (MAKE_OPCODE(i) | ((rc) & 0x1)) -#define M_MASK M_OPCODE(0x3f,0x1) - - -/*--------------------------------------------------- - * MD-Form Instructions: - * (none supported by MPC860) - *--------------------------------------------------- - * OPCD | S | A | sh | mb | XO |sh|Rc - * OPCD | S | A | sh | me | XO |sh|Rc - *---------------------------------------------------*/ - -#define MD_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0x7) << 2) | \ - ((rc) & 0x1)) -#define MD_MASK MD_OPCODE(0x3f,0x7,0x1) - - -/*--------------------------------------------------- - * MDS-Form Instructions: - * (none supported by MPC860) - *--------------------------------------------------- - * OPCD | S | A | B | mb | XO |Rc - * OPCD | S | A | B | me | XO |Rc - *---------------------------------------------------*/ - -#define MDS_OPCODE(i,xo,rc) (MAKE_OPCODE(i) | (((xo) & 0xf) << 1) | \ - ((rc) & 0x1)) -#define MDS_MASK MDS_OPCODE(0x3f,0xf,0x1) - -#define INSTRUCTION( memaddr ) ntohl(*(unsigned long *)(memaddr)) - -#define MAX_OPERANDS 8 - -struct ppc_ctx; - -struct opcode { - unsigned long opcode; /* The complete opcode as produced by - one of the XXX_OPCODE macros above */ - - unsigned long mask; /* The mask to use on an instruction - before comparing with the opcode - field to see if it matches */ - - enum OP_FIELD fields[MAX_OPERANDS]; - /* An array defining the operands for - this opcode. The values of the - array are the operand identifiers */ - - int (*hfunc)(struct ppc_ctx *); - /* Address of a function to handle the given - mnemonic */ - - char * name; /* The symbolic name of this opcode */ - - unsigned int hint; /* A bitwise-inclusive-OR of the - values shown below. These are used - tell the disassembler how to print - some operands for this opcode */ -}; - -/* values for opcode hints */ -#define H_RELATIVE 0x1 /* The address operand is relative */ -#define H_IMM_HIGH 0x2 /* [U|S]IMM field shifted high */ -#define H_RA0_IS_0 0x4 /* If rA = 0 then treat as literal 0 */ - -struct ppc_ctx { - struct opcode * op; - unsigned long instr; - unsigned int flags; - int datalen; - char data[ 256 ]; - char radix_fmt[ 8 ]; - unsigned char * virtual; -}; - - -/*====================================================================== - * - * FUNCTIONS - * - *======================================================================*/ - -/* Values for flags as passed to various ppc routines */ -#define F_RADOCTAL 0x1 /* output radix = unsigned octal */ -#define F_RADUDECIMAL 0x2 /* output radix = unsigned decimal */ -#define F_RADSDECIMAL 0x4 /* output radix = signed decimal */ -#define F_RADHEX 0x8 /* output radix = unsigned hex */ -#define F_SIMPLE 0x10 /* use simplified mnemonics */ -#define F_SYMBOL 0x20 /* use symbol lookups for addresses */ -#define F_INSTR 0x40 /* output the raw instruction */ -#define F_LOCALMEM 0x80 /* retrieve opcodes from local memory - rather than from the HMI */ -#define F_LINENO 0x100 /* show line number info if available */ -#define F_VALIDONLY 0x200 /* cache: valid entries only */ - -/* Values for assembler error codes */ -#define E_ASM_BAD_OPCODE 1 -#define E_ASM_NUM_OPERANDS 2 -#define E_ASM_BAD_REGISTER 3 -#define E_ASM_BAD_SPR 4 -#define E_ASM_BAD_TBR 5 - -extern int disppc __P((unsigned char *,unsigned char *,int, - int (*)(const char *), unsigned long)); -extern int print_source_line __P((char *,char *,int, - int (*pfunc)(const char *))); -extern int find_next_address __P((unsigned char *,int,struct pt_regs *)); -extern int handle_bc __P((struct ppc_ctx *)); -extern unsigned long asmppc __P((unsigned long,char*,int*)); -extern char *asm_error_str __P((int)); - -/*====================================================================== - * - * GLOBAL VARIABLES - * - *======================================================================*/ - -extern struct operand operands[]; -extern const unsigned int n_operands; -extern struct opcode opcodes[]; -extern const unsigned int n_opcodes; - -#endif /* _PPC_H */ - - -/* - * Copyright (c) 2000 William L. Pitts and W. Gerald Hicks - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/include/bedbug/regs.h b/include/bedbug/regs.h deleted file mode 100644 index 304a336cc2..0000000000 --- a/include/bedbug/regs.h +++ /dev/null @@ -1,400 +0,0 @@ -/* $Id$ */ - -#ifndef _REGS_H -#define _REGS_H - -/* Special Purpose Registers */ - -#define SPR_CR -1 -#define SPR_MSR -2 - -#define SPR_XER 1 -#define SPR_LR 8 -#define SPR_CTR 9 -#define SPR_DSISR 18 -#define SPR_DAR 19 -#define SPR_DEC 22 -#define SPR_SRR0 26 -#define SPR_SRR1 27 -#define SPR_EIE 80 -#define SPR_EID 81 -#define SPR_CMPA 144 -#define SPR_CMPB 145 -#define SPR_CMPC 146 -#define SPR_CMPD 147 -#define SPR_ICR 148 -#define SPR_DER 149 -#define SPR_COUNTA 150 -#define SPR_COUNTB 151 -#define SPR_CMPE 152 -#define SPR_CMPF 153 -#define SPR_CMPG 154 -#define SPR_CMPH 155 -#define SPR_LCTRL1 156 -#define SPR_LCTRL2 157 -#define SPR_ICTRL 158 -#define SPR_BAR 159 -#define SPR_USPRG0 256 -#define SPR_SPRG4_RO 260 -#define SPR_SPRG5_RO 261 -#define SPR_SPRG6_RO 262 -#define SPR_SPRG7_RO 263 -#define SPR_SPRG0 272 -#define SPR_SPRG1 273 -#define SPR_SPRG2 274 -#define SPR_SPRG3 275 -#define SPR_SPRG4 276 -#define SPR_SPRG5 277 -#define SPR_SPRG6 278 -#define SPR_SPRG7 279 -#define SPR_EAR 282 /* MPC603e core */ -#define SPR_TBL 284 -#define SPR_TBU 285 -#define SPR_PVR 287 -#define SPR_IC_CST 560 -#define SPR_IC_ADR 561 -#define SPR_IC_DAT 562 -#define SPR_DC_CST 568 -#define SPR_DC_ADR 569 -#define SPR_DC_DAT 570 -#define SPR_DPDR 630 -#define SPR_IMMR 638 -#define SPR_MI_CTR 784 -#define SPR_MI_AP 786 -#define SPR_MI_EPN 787 -#define SPR_MI_TWC 789 -#define SPR_MI_RPN 790 -#define SPR_MD_CTR 792 -#define SPR_M_CASID 793 -#define SPR_MD_AP 794 -#define SPR_MD_EPN 795 -#define SPR_M_TWB 796 -#define SPR_MD_TWC 797 -#define SPR_MD_RPN 798 -#define SPR_M_TW 799 -#define SPR_MI_DBCAM 816 -#define SPR_MI_DBRAM0 817 -#define SPR_MI_DBRAM1 818 -#define SPR_MD_DBCAM 824 -#define SPR_MD_DBRAM0 825 -#define SPR_MD_DBRAM1 826 -#define SPR_ZPR 944 -#define SPR_PID 945 -#define SPR_CCR0 947 -#define SPR_IAC3 948 -#define SPR_IAC4 949 -#define SPR_DVC1 950 -#define SPR_DVC2 951 -#define SPR_SGR 953 -#define SPR_DCWR 954 -#define SPR_SLER 955 -#define SPR_SU0R 956 -#define SPR_DBCR1 957 -#define SPR_ICDBDR 979 -#define SPR_ESR 980 -#define SPR_DEAR 981 -#define SPR_EVPR 982 -#define SPR_TSR 984 -#define SPR_TCR 986 -#define SPR_PIT 987 -#define SPR_SRR2 990 -#define SPR_SRR3 991 -#define SPR_DBSR 1008 -#define SPR_DBCR0 1010 -#define SPR_IABR 1010 /* MPC603e core */ -#define SPR_IAC1 1012 -#define SPR_IAC2 1013 -#define SPR_DAC1 1014 -#define SPR_DAC2 1015 -#define SPR_DCCR 1018 -#define SPR_ICCR 1019 - -/* Bits for the DBCR0 register */ -#define DBCR0_EDM 0x80000000 -#define DBCR0_IDM 0x40000000 -#define DBCR0_RST 0x30000000 -#define DBCR0_IC 0x08000000 -#define DBCR0_BT 0x04000000 -#define DBCR0_EDE 0x02000000 -#define DBCR0_TDE 0x01000000 -#define DBCR0_IA1 0x00800000 -#define DBCR0_IA2 0x00400000 -#define DBCR0_IA12 0x00200000 -#define DBCR0_IA12X 0x00100000 -#define DBCR0_IA3 0x00080000 -#define DBCR0_IA4 0x00040000 -#define DBCR0_IA34 0x00020000 -#define DBCR0_IA34X 0x00010000 -#define DBCR0_IA12T 0x00008000 -#define DBCR0_IA34T 0x00004000 -#define DBCR0_FT 0x00000001 - -/* Bits for the DBCR1 register */ -#define DBCR1_D1R 0x80000000 -#define DBCR1_D2R 0x40000000 -#define DBCR1_D1W 0x20000000 -#define DBCR1_D2W 0x10000000 -#define DBCR1_D1S 0x0C000000 -#define DBCR1_D2S 0x03000000 -#define DBCR1_DA12 0x00800000 -#define DBCR1_DA12X 0x00400000 -#define DBCR1_DV1M 0x000C0000 -#define DBCR1_DV2M 0x00030000 -#define DBCR1_DV1BE 0x0000F000 -#define DBCR1_DV2BE 0x00000F00 - -/* - * DBSR bits which have conflicting definitions on true Book E versus PPC40x - */ -#ifdef CONFIG_BOOKE -#define DBSR_IA1 0x00800000 /* Instr Address Compare 1 Event */ -#define DBSR_IA2 0x00400000 /* Instr Address Compare 2 Event */ -#define DBSR_IA3 0x00200000 /* Instr Address Compare 3 Event */ -#define DBSR_IA4 0x00100000 /* Instr Address Compare 4 Event */ -#endif -#define DBSR_IA1 0x04000000 /* Instr Address Compare 1 Event */ -#define DBSR_IA2 0x02000000 /* Instr Address Compare 2 Event */ -#define DBSR_IA3 0x00080000 /* Instr Address Compare 3 Event */ -#define DBSR_IA4 0x00040000 /* Instr Address Compare 4 Event */ - -struct spr_info { - int spr_val; - char spr_name[ 10 ]; -}; - -extern struct spr_info spr_map[]; -extern const unsigned int n_sprs; - - -#define SET_REGISTER( str, val ) \ -({ unsigned long __value = (val); \ - asm volatile( str : : "r" (__value)); \ - __value; }) - -#define GET_REGISTER( str ) \ -({ unsigned long __value; \ - asm volatile( str : "=r" (__value) : ); \ - __value; }) - -#define GET_CR() GET_REGISTER( "mfcr %0" ) -#define SET_CR(val) SET_REGISTER( "mtcr %0", val ) -#define GET_MSR() GET_REGISTER( "mfmsr %0" ) -#define SET_MSR(val) SET_REGISTER( "mtmsr %0", val ) -#define GET_XER() GET_REGISTER( "mfspr %0,1" ) -#define SET_XER(val) SET_REGISTER( "mtspr 1,%0", val ) -#define GET_LR() GET_REGISTER( "mfspr %0,8" ) -#define SET_LR(val) SET_REGISTER( "mtspr 8,%0", val ) -#define GET_CTR() GET_REGISTER( "mfspr %0,9" ) -#define SET_CTR(val) SET_REGISTER( "mtspr 9,%0", val ) -#define GET_DSISR() GET_REGISTER( "mfspr %0,18" ) -#define SET_DSISR(val) SET_REGISTER( "mtspr 18,%0", val ) -#define GET_DAR() GET_REGISTER( "mfspr %0,19" ) -#define SET_DAR(val) SET_REGISTER( "mtspr 19,%0", val ) -#define GET_DEC() GET_REGISTER( "mfspr %0,22" ) -#define SET_DEC(val) SET_REGISTER( "mtspr 22,%0", val ) -#define GET_SRR0() GET_REGISTER( "mfspr %0,26" ) -#define SET_SRR0(val) SET_REGISTER( "mtspr 26,%0", val ) -#define GET_SRR1() GET_REGISTER( "mfspr %0,27" ) -#define SET_SRR1(val) SET_REGISTER( "mtspr 27,%0", val ) -#define GET_EIE() GET_REGISTER( "mfspr %0,80" ) -#define SET_EIE(val) SET_REGISTER( "mtspr 80,%0", val ) -#define GET_EID() GET_REGISTER( "mfspr %0,81" ) -#define SET_EID(val) SET_REGISTER( "mtspr 81,%0", val ) -#define GET_CMPA() GET_REGISTER( "mfspr %0,144" ) -#define SET_CMPA(val) SET_REGISTER( "mtspr 144,%0", val ) -#define GET_CMPB() GET_REGISTER( "mfspr %0,145" ) -#define SET_CMPB(val) SET_REGISTER( "mtspr 145,%0", val ) -#define GET_CMPC() GET_REGISTER( "mfspr %0,146" ) -#define SET_CMPC(val) SET_REGISTER( "mtspr 146,%0", val ) -#define GET_CMPD() GET_REGISTER( "mfspr %0,147" ) -#define SET_CMPD(val) SET_REGISTER( "mtspr 147,%0", val ) -#define GET_ICR() GET_REGISTER( "mfspr %0,148" ) -#define SET_ICR(val) SET_REGISTER( "mtspr 148,%0", val ) -#define GET_DER() GET_REGISTER( "mfspr %0,149" ) -#define SET_DER(val) SET_REGISTER( "mtspr 149,%0", val ) -#define GET_COUNTA() GET_REGISTER( "mfspr %0,150" ) -#define SET_COUNTA(val) SET_REGISTER( "mtspr 150,%0", val ) -#define GET_COUNTB() GET_REGISTER( "mfspr %0,151" ) -#define SET_COUNTB(val) SET_REGISTER( "mtspr 151,%0", val ) -#define GET_CMPE() GET_REGISTER( "mfspr %0,152" ) -#define SET_CMPE(val) SET_REGISTER( "mtspr 152,%0", val ) -#define GET_CMPF() GET_REGISTER( "mfspr %0,153" ) -#define SET_CMPF(val) SET_REGISTER( "mtspr 153,%0", val ) -#define GET_CMPG() GET_REGISTER( "mfspr %0,154" ) -#define SET_CMPG(val) SET_REGISTER( "mtspr 154,%0", val ) -#define GET_CMPH() GET_REGISTER( "mfspr %0,155" ) -#define SET_CMPH(val) SET_REGISTER( "mtspr 155,%0", val ) -#define GET_LCTRL1() GET_REGISTER( "mfspr %0,156" ) -#define SET_LCTRL1(val) SET_REGISTER( "mtspr 156,%0", val ) -#define GET_LCTRL2() GET_REGISTER( "mfspr %0,157" ) -#define SET_LCTRL2(val) SET_REGISTER( "mtspr 157,%0", val ) -#define GET_ICTRL() GET_REGISTER( "mfspr %0,158" ) -#define SET_ICTRL(val) SET_REGISTER( "mtspr 158,%0", val ) -#define GET_BAR() GET_REGISTER( "mfspr %0,159" ) -#define SET_BAR(val) SET_REGISTER( "mtspr 159,%0", val ) -#define GET_USPRG0() GET_REGISTER( "mfspr %0,256" ) -#define SET_USPRG0(val) SET_REGISTER( "mtspr 256,%0", val ) -#define GET_SPRG4_RO() GET_REGISTER( "mfspr %0,260" ) -#define SET_SPRG4_RO(val) SET_REGISTER( "mtspr 260,%0", val ) -#define GET_SPRG5_RO() GET_REGISTER( "mfspr %0,261" ) -#define SET_SPRG5_RO(val) SET_REGISTER( "mtspr 261,%0", val ) -#define GET_SPRG6_RO() GET_REGISTER( "mfspr %0,262" ) -#define SET_SPRG6_RO(val) SET_REGISTER( "mtspr 262,%0", val ) -#define GET_SPRG7_RO() GET_REGISTER( "mfspr %0,263" ) -#define SET_SPRG7_RO(val) SET_REGISTER( "mtspr 263,%0", val ) -#define GET_SPRG0() GET_REGISTER( "mfspr %0,272" ) -#define SET_SPRG0(val) SET_REGISTER( "mtspr 272,%0", val ) -#define GET_SPRG1() GET_REGISTER( "mfspr %0,273" ) -#define SET_SPRG1(val) SET_REGISTER( "mtspr 273,%0", val ) -#define GET_SPRG2() GET_REGISTER( "mfspr %0,274" ) -#define SET_SPRG2(val) SET_REGISTER( "mtspr 274,%0", val ) -#define GET_SPRG3() GET_REGISTER( "mfspr %0,275" ) -#define SET_SPRG3(val) SET_REGISTER( "mtspr 275,%0", val ) -#define GET_SPRG4() GET_REGISTER( "mfspr %0,276" ) -#define SET_SPRG4(val) SET_REGISTER( "mtspr 276,%0", val ) -#define GET_SPRG5() GET_REGISTER( "mfspr %0,277" ) -#define SET_SPRG5(val) SET_REGISTER( "mtspr 277,%0", val ) -#define GET_SPRG6() GET_REGISTER( "mfspr %0,278" ) -#define SET_SPRG6(val) SET_REGISTER( "mtspr 278,%0", val ) -#define GET_SPRG7() GET_REGISTER( "mfspr %0,279" ) -#define SET_SPRG7(val) SET_REGISTER( "mtspr 279,%0", val ) -#define GET_EAR() GET_REGISTER( "mfspr %0,282" ) -#define SET_EAR(val) SET_REGISTER( "mtspr 282,%0", val ) -#define GET_TBL() GET_REGISTER( "mfspr %0,284" ) -#define SET_TBL(val) SET_REGISTER( "mtspr 284,%0", val ) -#define GET_TBU() GET_REGISTER( "mfspr %0,285" ) -#define SET_TBU(val) SET_REGISTER( "mtspr 285,%0", val ) -#define GET_PVR() GET_REGISTER( "mfspr %0,287" ) -#define SET_PVR(val) SET_REGISTER( "mtspr 287,%0", val ) -#define GET_IC_CST() GET_REGISTER( "mfspr %0,560" ) -#define SET_IC_CST(val) SET_REGISTER( "mtspr 560,%0", val ) -#define GET_IC_ADR() GET_REGISTER( "mfspr %0,561" ) -#define SET_IC_ADR(val) SET_REGISTER( "mtspr 561,%0", val ) -#define GET_IC_DAT() GET_REGISTER( "mfspr %0,562" ) -#define SET_IC_DAT(val) SET_REGISTER( "mtspr 562,%0", val ) -#define GET_DC_CST() GET_REGISTER( "mfspr %0,568" ) -#define SET_DC_CST(val) SET_REGISTER( "mtspr 568,%0", val ) -#define GET_DC_ADR() GET_REGISTER( "mfspr %0,569" ) -#define SET_DC_ADR(val) SET_REGISTER( "mtspr 569,%0", val ) -#define GET_DC_DAT() GET_REGISTER( "mfspr %0,570" ) -#define SET_DC_DAT(val) SET_REGISTER( "mtspr 570,%0", val ) -#define GET_DPDR() GET_REGISTER( "mfspr %0,630" ) -#define SET_DPDR(val) SET_REGISTER( "mtspr 630,%0", val ) -#define GET_IMMR() GET_REGISTER( "mfspr %0,638" ) -#define SET_IMMR(val) SET_REGISTER( "mtspr 638,%0", val ) -#define GET_MI_CTR() GET_REGISTER( "mfspr %0,784" ) -#define SET_MI_CTR(val) SET_REGISTER( "mtspr 784,%0", val ) -#define GET_MI_AP() GET_REGISTER( "mfspr %0,786" ) -#define SET_MI_AP(val) SET_REGISTER( "mtspr 786,%0", val ) -#define GET_MI_EPN() GET_REGISTER( "mfspr %0,787" ) -#define SET_MI_EPN(val) SET_REGISTER( "mtspr 787,%0", val ) -#define GET_MI_TWC() GET_REGISTER( "mfspr %0,789" ) -#define SET_MI_TWC(val) SET_REGISTER( "mtspr 789,%0", val ) -#define GET_MI_RPN() GET_REGISTER( "mfspr %0,790" ) -#define SET_MI_RPN(val) SET_REGISTER( "mtspr 790,%0", val ) -#define GET_MD_CTR() GET_REGISTER( "mfspr %0,792" ) -#define SET_MD_CTR(val) SET_REGISTER( "mtspr 792,%0", val ) -#define GET_M_CASID() GET_REGISTER( "mfspr %0,793" ) -#define SET_M_CASID(val) SET_REGISTER( "mtspr 793,%0", val ) -#define GET_MD_AP() GET_REGISTER( "mfspr %0,794" ) -#define SET_MD_AP(val) SET_REGISTER( "mtspr ,794%0", val ) -#define GET_MD_EPN() GET_REGISTER( "mfspr %0,795" ) -#define SET_MD_EPN(val) SET_REGISTER( "mtspr 795,%0", val ) -#define GET_M_TWB() GET_REGISTER( "mfspr %0,796" ) -#define SET_M_TWB(val) SET_REGISTER( "mtspr 796,%0", val ) -#define GET_MD_TWC() GET_REGISTER( "mfspr %0,797" ) -#define SET_MD_TWC(val) SET_REGISTER( "mtspr 797,%0", val ) -#define GET_MD_RPN() GET_REGISTER( "mfspr %0,798" ) -#define SET_MD_RPN(val) SET_REGISTER( "mtspr 798,%0", val ) -#define GET_M_TW() GET_REGISTER( "mfspr %0,799" ) -#define SET_M_TW(val) SET_REGISTER( "mtspr 799,%0", val ) -#define GET_MI_DBCAM() GET_REGISTER( "mfspr %0,816" ) -#define SET_MI_DBCAM(val) SET_REGISTER( "mtspr 816,%0", val ) -#define GET_MI_DBRAM0() GET_REGISTER( "mfspr %0,817" ) -#define SET_MI_DBRAM0(val) SET_REGISTER( "mtspr 817,%0", val ) -#define GET_MI_DBRAM1() GET_REGISTER( "mfspr %0,818" ) -#define SET_MI_DBRAM1(val) SET_REGISTER( "mtspr 818,%0", val ) -#define GET_MD_DBCAM() GET_REGISTER( "mfspr %0,824" ) -#define SET_MD_DBCA(val) SET_REGISTER( "mtspr 824,%0", val ) -#define GET_MD_DBRAM0() GET_REGISTER( "mfspr %0,825" ) -#define SET_MD_DBRAM0(val) SET_REGISTER( "mtspr 825,%0", val ) -#define GET_MD_DBRAM1() GET_REGISTER( "mfspr %0,826" ) -#define SET_MD_DBRAM1(val) SET_REGISTER( "mtspr 826,%0", val ) -#define GET_ZPR() GET_REGISTER( "mfspr %0,944" ) -#define SET_ZPR(val) SET_REGISTER( "mtspr 944,%0", val ) -#define GET_PID() GET_REGISTER( "mfspr %0,945" ) -#define SET_PID(val) SET_REGISTER( "mtspr 945,%0", val ) -#define GET_CCR0() GET_REGISTER( "mfspr %0,947" ) -#define SET_CCR0(val) SET_REGISTER( "mtspr 947,%0", val ) -#define GET_IAC3() GET_REGISTER( "mfspr %0,948" ) -#define SET_IAC3(val) SET_REGISTER( "mtspr 948,%0", val ) -#define GET_IAC4() GET_REGISTER( "mfspr %0,949" ) -#define SET_IAC4(val) SET_REGISTER( "mtspr 949,%0", val ) -#define GET_DVC1() GET_REGISTER( "mfspr %0,950" ) -#define SET_DVC1(val) SET_REGISTER( "mtspr 950,%0", val ) -#define GET_DVC2() GET_REGISTER( "mfspr %0,951" ) -#define SET_DVC2(val) SET_REGISTER( "mtspr 951,%0", val ) -#define GET_SGR() GET_REGISTER( "mfspr %0,953" ) -#define SET_SGR(val) SET_REGISTER( "mtspr 953,%0", val ) -#define GET_DCWR() GET_REGISTER( "mfspr %0,954" ) -#define SET_DCWR(val) SET_REGISTER( "mtspr 954,%0", val ) -#define GET_SLER() GET_REGISTER( "mfspr %0,955" ) -#define SET_SLER(val) SET_REGISTER( "mtspr 955,%0", val ) -#define GET_SU0R() GET_REGISTER( "mfspr %0,956" ) -#define SET_SU0R(val) SET_REGISTER( "mtspr 956,%0", val ) -#define GET_DBCR1() GET_REGISTER( "mfspr %0,957" ) -#define SET_DBCR1(val) SET_REGISTER( "mtspr 957,%0", val ) -#define GET_ICDBDR() GET_REGISTER( "mfspr %0,979" ) -#define SET_ICDBDR(val) SET_REGISTER( "mtspr 979,%0", val ) -#define GET_ESR() GET_REGISTER( "mfspr %0,980" ) -#define SET_ESR(val) SET_REGISTER( "mtspr 980,%0", val ) -#define GET_DEAR() GET_REGISTER( "mfspr %0,981" ) -#define SET_DEAR(val) SET_REGISTER( "mtspr 981,%0", val ) -#define GET_EVPR() GET_REGISTER( "mfspr %0,982" ) -#define SET_EVPR(val) SET_REGISTER( "mtspr 982,%0", val ) -#define GET_TSR() GET_REGISTER( "mfspr %0,984" ) -#define SET_TSR(val) SET_REGISTER( "mtspr 984,%0", val ) -#define GET_TCR() GET_REGISTER( "mfspr %0,986" ) -#define SET_TCR(val) SET_REGISTER( "mtspr 986,%0", val ) -#define GET_PIT() GET_REGISTER( "mfspr %0,987" ) -#define SET_PIT(val) SET_REGISTER( "mtspr 987,%0", val ) -#define GET_SRR2() GET_REGISTER( "mfspr %0,990" ) -#define SET_SRR2(val) SET_REGISTER( "mtspr 990,%0", val ) -#define GET_SRR3() GET_REGISTER( "mfspr %0,991" ) -#define SET_SRR3(val) SET_REGISTER( "mtspr 991,%0", val ) -#define GET_DBSR() GET_REGISTER( "mfspr %0,1008" ) -#define SET_DBSR(val) SET_REGISTER( "mtspr 1008,%0", val ) -#define GET_DBCR0() GET_REGISTER( "mfspr %0,1010" ) -#define SET_DBCR0(val) SET_REGISTER( "mtspr 1010,%0", val ) -#define GET_IABR() GET_REGISTER( "mfspr %0,1010" ) -#define SET_IABR(val) SET_REGISTER( "mtspr 1010,%0", val ) -#define GET_IAC1() GET_REGISTER( "mfspr %0,1012" ) -#define SET_IAC1(val) SET_REGISTER( "mtspr 1012,%0", val ) -#define GET_IAC2() GET_REGISTER( "mfspr %0,1013" ) -#define SET_IAC2(val) SET_REGISTER( "mtspr 1013,%0", val ) -#define GET_DAC1() GET_REGISTER( "mfspr %0,1014" ) -#define SET_DAC1(val) SET_REGISTER( "mtspr 1014,%0", val ) -#define GET_DAC2() GET_REGISTER( "mfspr %0,1015" ) -#define SET_DAC2(val) SET_REGISTER( "mtspr 1015,%0", val ) -#define GET_DCCR() GET_REGISTER( "mfspr %0,1018" ) -#define SET_DCCR(val) SET_REGISTER( "mtspr 1018,%0", val ) -#define GET_ICCR() GET_REGISTER( "mfspr %0,1019" ) -#define SET_ICCR(val) SET_REGISTER( "mtspr 1019,%0", val ) - -#endif /* _REGS_H */ - - -/* - * Copyright (c) 2000 William L. Pitts and W. Gerald Hicks - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/include/bedbug/tables.h b/include/bedbug/tables.h deleted file mode 100644 index e675de3209..0000000000 --- a/include/bedbug/tables.h +++ /dev/null @@ -1,601 +0,0 @@ -/* $Id$ */ - -#ifndef TABLES_H -#define TABLES_H - -/* This is only included by common/bedbug.c, and depends on the following - * files to already be included - * common.h - * bedbug/bedbug.h - * bedbug/ppc.h - * bedbug/regs.h - */ - -struct operand operands[] = { - /*Field Name Bits Shift Hint Position */ - /*----- ------ ----- ----- ---- ------------ */ - { O_AA, "O_AA", 1, 1, OH_SILENT }, /* 30 */ - { O_BD, "O_BD", 14, 2, OH_ADDR }, /* 16-29 */ - { O_BI, "O_BI", 5, 16, 0 }, /* 11-15 */ - { O_BO, "O_BO", 5, 21, 0 }, /* 6-10 */ - { O_crbD, "O_crbD", 5, 21, 0 }, /* 6-10 */ - { O_crbA, "O_crbA", 5, 16, 0 }, /* 11-15 */ - { O_crbB, "O_crbB", 5, 11, 0 }, /* 16-20 */ - { O_CRM, "O_CRM", 8, 12, 0 }, /* 12-19 */ - { O_d, "O_d", 15, 0, OH_OFFSET }, /* 16-31 */ - { O_frC, "O_frC", 5, 6, 0 }, /* 21-25 */ - { O_frD, "O_frD", 5, 21, 0 }, /* 6-10 */ - { O_frS, "O_frS", 5, 21, 0 }, /* 6-10 */ - { O_IMM, "O_IMM", 4, 12, 0 }, /* 16-19 */ - { O_LI, "O_LI", 24, 2, OH_ADDR }, /* 6-29 */ - { O_LK, "O_LK", 1, 0, OH_SILENT }, /* 31 */ - { O_MB, "O_MB", 5, 6, 0 }, /* 21-25 */ - { O_ME, "O_ME", 5, 1, 0 }, /* 26-30 */ - { O_NB, "O_NB", 5, 11, 0 }, /* 16-20 */ - { O_OE, "O_OE", 1, 10, OH_SILENT }, /* 21 */ - { O_rA, "O_rA", 5, 16, OH_REG }, /* 11-15 */ - { O_rB, "O_rB", 5, 11, OH_REG }, /* 16-20 */ - { O_Rc, "O_Rc", 1, 0, OH_SILENT }, /* 31 */ - { O_rD, "O_rD", 5, 21, OH_REG }, /* 6-10 */ - { O_rS, "O_rS", 5, 21, OH_REG }, /* 6-10 */ - { O_SH, "O_SH", 5, 11, 0 }, /* 16-20 */ - { O_SIMM, "O_SIMM", 16, 0, 0 }, /* 16-31 */ - { O_SR, "O_SR", 4, 16, 0 }, /* 12-15 */ - { O_TO, "O_TO", 5, 21, 0 }, /* 6-10 */ - { O_UIMM, "O_UIMM", 16, 0, 0 }, /* 16-31 */ - { O_crfD, "O_crfD", 3, 23, 0 }, /* 6- 8 */ - { O_crfS, "O_crfS", 3, 18, 0 }, /* 11-13 */ - { O_L, "O_L", 1, 21, 0 }, /* 10 */ - { O_spr, "O_spr", 10, 11, OH_SPR }, /* 11-20 */ - { O_tbr, "O_tbr", 10, 11, OH_TBR }, /* 11-20 */ - { O_cr2, "O_cr2", 0, 0, OH_LITERAL }, /* "cr2" */ -}; - -const unsigned int n_operands = sizeof(operands) / sizeof(operands[0]); - -/* A note about the fields array in the opcodes structure: - The operands are listed in the order they appear in the output. - - This table is arranged in numeric order of the opcode. Note that some - opcodes have defined bits in odd places so not all forms of a command - will be in the same place. This is done so that a binary search can be - done to find the opcodes. Note that table D.2 in the MPC860 User's - Manual "Instructions Sorted by Opcode" does not account for these - bit locations */ - -struct opcode opcodes[] = { - { D_OPCODE(3), D_MASK, {O_TO, O_rA, O_SIMM, 0}, - 0, "twi", 0 }, - { D_OPCODE(7), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "mulli", 0 }, - { D_OPCODE(8), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "subfic", 0 }, - { D_OPCODE(10), D_MASK, {O_crfD, O_L, O_rA, O_UIMM, 0}, - 0, "cmpli", 0 }, - { D_OPCODE(11), D_MASK, {O_crfD, O_L, O_rA, O_SIMM, 0}, - 0, "cmpi", 0 }, - { D_OPCODE(12), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "addic", 0 }, - { D_OPCODE(13), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "addic.", 0 }, - { D_OPCODE(14), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "addi", H_RA0_IS_0 }, - { D_OPCODE(15), D_MASK, {O_rD, O_rA, O_SIMM, 0}, - 0, "addis", H_RA0_IS_0|H_IMM_HIGH }, - { B_OPCODE(16,0,0), B_MASK, {O_BO, O_BI, O_BD, O_AA, O_LK, 0}, - handle_bc, "bc", H_RELATIVE }, - { B_OPCODE(16,0,1), B_MASK, {O_BO, O_BI, O_BD, O_AA, O_LK, 0}, - 0, "bcl", H_RELATIVE }, - { B_OPCODE(16,1,0), B_MASK, {O_BO, O_BI, O_BD, O_AA, O_LK, 0}, - 0, "bca", 0 }, - { B_OPCODE(16,1,1), B_MASK, {O_BO, O_BI, O_BD, O_AA, O_LK, 0}, - 0, "bcla", 0 }, - { SC_OPCODE(17), SC_MASK, {0}, - 0, "sc", 0 }, - { I_OPCODE(18,0,0), I_MASK, {O_LI, O_AA, O_LK, 0}, - 0, "b", H_RELATIVE }, - { I_OPCODE(18,0,1), I_MASK, {O_LI, O_AA, O_LK, 0}, - 0, "bl", H_RELATIVE }, - { I_OPCODE(18,1,0), I_MASK, {O_LI, O_AA, O_LK, 0}, - 0, "ba", 0 }, - { I_OPCODE(18,1,1), I_MASK, {O_LI, O_AA, O_LK, 0}, - 0, "bla", 0 }, - { XL_OPCODE(19,0,0), XL_MASK, {O_crfD, O_crfS}, - 0, "mcrf", 0 }, - { XL_OPCODE(19,16,0), XL_MASK, {O_BO, O_BI, O_LK, 0}, - 0, "bclr", 0 }, - { XL_OPCODE(19,16,1), XL_MASK, {O_BO, O_BI, O_LK, 0}, - 0, "bclrl", 0 }, - { XL_OPCODE(19,33,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crnor", 0 }, - { XL_OPCODE(19,50,0), XL_MASK, {0}, - 0, "rfi", 0 }, - { XL_OPCODE(19,129,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crandc", 0 }, - { XL_OPCODE(19,150,0), XL_MASK, {0}, - 0, "isync", 0 }, - { XL_OPCODE(19,193,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crxor", 0 }, - { XL_OPCODE(19,225,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crnand", 0 }, - { XL_OPCODE(19,257,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crand", 0 }, - { XL_OPCODE(19,289,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "creqv", 0 }, - { XL_OPCODE(19,417,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "crorc", 0 }, - { XL_OPCODE(19,449,0), XL_MASK, {O_crbD, O_crbA, O_crbB, 0}, - 0, "cror", 0 }, - { XL_OPCODE(19,528,0), XL_MASK, {O_BO, O_BI, O_LK, 0}, - 0, "bcctr", 0 }, - { XL_OPCODE(19,528,1), XL_MASK, {O_BO, O_BI, O_LK, 0}, - 0, "bcctrl", 0 }, - { M_OPCODE(20,0), M_MASK, {O_rA, O_rS, O_SH, O_MB, O_ME, O_Rc, 0}, - 0, "rlwimi", 0 }, - { M_OPCODE(20,1), M_MASK, {O_rA, O_rS, O_SH, O_MB, O_ME, O_Rc, 0}, - 0, "rlwimi.", 0 }, - { M_OPCODE(21,0), M_MASK, {O_rA, O_rS, O_SH, O_MB, O_ME, O_Rc, 0}, - 0, "rlwinm", 0 }, - { M_OPCODE(21,1), M_MASK, {O_rA, O_rS, O_SH, O_MB, O_ME, O_Rc, 0}, - 0, "rlwinm.", 0 }, - { M_OPCODE(23,0), M_MASK, {O_rA, O_rS, O_rB, O_MB, O_ME, O_Rc, 0}, - 0, "rlwnm", 0 }, - { M_OPCODE(23,1), M_MASK, {O_rA, O_rS, O_rB, O_MB, O_ME, O_Rc, 0}, - 0, "rlwnm.", 0 }, - { D_OPCODE(24), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "ori", 0 }, - { D_OPCODE(25), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "oris", H_IMM_HIGH }, - { D_OPCODE(26), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "xori", 0 }, - { D_OPCODE(27), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "xoris", H_IMM_HIGH }, - { D_OPCODE(28), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "andi.", 0 }, - { D_OPCODE(29), D_MASK, {O_rA, O_rS, O_UIMM, 0}, - 0, "andis.", H_IMM_HIGH }, - { X_OPCODE(31,0,0), X_MASK, {O_crfD, O_L, O_rA, O_rB, 0}, - 0, "cmp", 0 }, - { X_OPCODE(31,4,0), X_MASK, {O_TO, O_rA, O_rB, 0}, - 0, "tw", 0 }, - { XO_OPCODE(31,8,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfc", 0 }, - { XO_OPCODE(31,8,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfc.", 0 }, - { XO_OPCODE(31,10,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addc", 0 }, - { XO_OPCODE(31,10,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addc.", 0 }, - { XO_OPCODE(31,11,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_Rc, 0}, - 0, "mulhwu", 0 }, - { XO_OPCODE(31,11,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_Rc, 0}, - 0, "mulhwu.", 0 }, - { X_OPCODE(31,19,0), X_MASK, {O_rD, 0}, - 0, "mfcr", 0 }, - { X_OPCODE(31,20,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lwarx", H_RA0_IS_0 }, - { X_OPCODE(31,23,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lwzx", H_RA0_IS_0 }, - { X_OPCODE(31,24,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "slw", 0 }, - { X_OPCODE(31,24,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "slw.", 0 }, - { X_OPCODE(31,26,0), X_MASK, {O_rA, O_rS, O_Rc, 0 }, - 0, "cntlzw", 0 }, - { X_OPCODE(31,26,1), X_MASK, {O_rA, O_rS, O_Rc, 0}, - 0, "cntlzw.", 0 }, - { X_OPCODE(31,28,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "and", 0 }, - { X_OPCODE(31,28,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "and.", 0 }, - { X_OPCODE(31,32,0), X_MASK, {O_crfD, O_L, O_rA, O_rB, 0}, - 0, "cmpl", 0 }, - { XO_OPCODE(31,40,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subf", 0 }, - { XO_OPCODE(31,40,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subf.", 0 }, - { X_OPCODE(31,54,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbst", H_RA0_IS_0 }, - { X_OPCODE(31,55,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lwzux", 0 }, - { X_OPCODE(31,60,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "andc", 0 }, - { X_OPCODE(31,60,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "andc.", 0 }, - { XO_OPCODE(31,75,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_Rc, 0}, - 0, "mulhw", 0 }, - { XO_OPCODE(31,75,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_Rc, 0}, - 0, "mulhw.", 0 }, - { X_OPCODE(31,83,0), X_MASK, {O_rD, 0}, - 0, "mfmsr", 0 }, - { X_OPCODE(31,86,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbf", H_RA0_IS_0 }, - { X_OPCODE(31,87,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lbzx", H_RA0_IS_0 }, - { XO_OPCODE(31,104,0,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "neg", 0 }, - { XO_OPCODE(31,104,0,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "neg.", 0 }, - { X_OPCODE(31,119,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lbzux", 0 }, - { X_OPCODE(31,124,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "nor", 0 }, - { X_OPCODE(31,124,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "nor.", 0 }, - { XO_OPCODE(31,136,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfe", 0 }, - { XO_OPCODE(31,136,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfe.", 0 }, - { XO_OPCODE(31,138,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "adde", 0 }, - { XO_OPCODE(31,138,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "adde.", 0 }, - { XFX_OPCODE(31,144,0), XFX_MASK, {O_CRM, O_rS, 0}, - 0, "mtcrf", 0 }, - { X_OPCODE(31,146,0), X_MASK, {O_rS, 0}, - 0, "mtmsr", 0 }, - { X_OPCODE(31,150,1), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stwcx.", 0 }, - { X_OPCODE(31,151,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stwx", 0 }, - { X_OPCODE(31,183,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stwux", 0 }, - { XO_OPCODE(31,200,0,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfze", 0 }, - { XO_OPCODE(31,200,0,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfze.", 0 }, - { XO_OPCODE(31,202,0,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addze", 0 }, - { XO_OPCODE(31,202,0,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addze.", 0 }, - { X_OPCODE(31,210,0), X_MASK, {O_SR, O_rS, 0}, - 0, "mtsr", 0 }, - { X_OPCODE(31,215,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stbx", H_RA0_IS_0 }, - { XO_OPCODE(31,232,0,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfme", 0 }, - { XO_OPCODE(31,232,0,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfme.", 0 }, - { XO_OPCODE(31,234,0,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addme", 0 }, - { XO_OPCODE(31,234,0,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addme.", 0 }, - { XO_OPCODE(31,235,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "mullw", 0 }, - { XO_OPCODE(31,235,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "mullw.", 0 }, - { X_OPCODE(31,242,0), X_MASK, {O_rS, O_rB, 0}, - 0, "mtsrin", 0 }, - { X_OPCODE(31,246,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbtst", H_RA0_IS_0 }, - { X_OPCODE(31,247,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stbux", 0 }, - { XO_OPCODE(31,266,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "add", 0 }, - { XO_OPCODE(31,266,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "add.", 0 }, - { X_OPCODE(31,278,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbt", H_RA0_IS_0 }, - { X_OPCODE(31,279,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lhzx", H_RA0_IS_0 }, - { X_OPCODE(31,284,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "eqv", 0 }, - { X_OPCODE(31,284,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "eqv.", 0 }, - { X_OPCODE(31,306,0), X_MASK, {O_rB, 0}, - 0, "tlbie", 0 }, - { X_OPCODE(31,310,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "eciwx", H_RA0_IS_0 }, - { X_OPCODE(31,311,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lhzux", 0 }, - { X_OPCODE(31,316,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "xor", 0 }, - { X_OPCODE(31,316,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "xor.", 0 }, - { XFX_OPCODE(31,339,0), XFX_MASK, {O_rD, O_spr, 0}, - 0, "mfspr", 0 }, - { X_OPCODE(31,343,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lhax", H_RA0_IS_0 }, - { X_OPCODE(31,370,0), X_MASK, {0}, - 0, "tlbia", 0 }, - { XFX_OPCODE(31,371,0), XFX_MASK, {O_rD, O_tbr, 0}, - 0, "mftb", 0 }, - { X_OPCODE(31,375,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lhaux", 0 }, - { X_OPCODE(31,407,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "sthx", H_RA0_IS_0 }, - { X_OPCODE(31,412,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "orc", 0 }, - { X_OPCODE(31,412,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "orc.", 0 }, - { X_OPCODE(31,438,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "ecowx", H_RA0_IS_0 }, - { X_OPCODE(31,439,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "sthux", 0 }, - { X_OPCODE(31,444,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "or", 0 }, - { X_OPCODE(31,444,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "or.", 0 }, - { XO_OPCODE(31,459,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwu", 0 }, - { XO_OPCODE(31,459,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwu.", 0 }, - { XFX_OPCODE(31,467,0), XFX_MASK, {O_spr, O_rS, 0}, - 0, "mtspr", 0 }, - { X_OPCODE(31,470,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbi", H_RA0_IS_0 }, - { X_OPCODE(31,476,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "nand", 0 }, - { X_OPCODE(31,476,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc,0}, - 0, "nand.", 0 }, - { XO_OPCODE(31,491,0,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divw", 0 }, - { XO_OPCODE(31,491,0,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divw.", 0 }, - { X_OPCODE(31,512,0), X_MASK, {O_crfD, 0}, - 0, "mcrxr", 0 }, - { XO_OPCODE(31,8,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfco", 0 }, - { XO_OPCODE(31,8,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfco.", 0 }, - { XO_OPCODE(31,10,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addco", 0 }, - { XO_OPCODE(31,10,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addco.", 0 }, - { X_OPCODE(31,533,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lswx", H_RA0_IS_0 }, - { X_OPCODE(31,534,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lwbrx", H_RA0_IS_0 }, - { X_OPCODE(31,536,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "srw", 0 }, - { X_OPCODE(31,536,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "srw.", 0 }, - { XO_OPCODE(31,40,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfo", 0 }, - { XO_OPCODE(31,40,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfo.", 0 }, - { X_OPCODE(31,566,0), X_MASK, {0}, - 0, "tlbsync", 0 }, - { X_OPCODE(31,595,0), X_MASK, {O_rD, O_SR, 0}, - 0, "mfsr", 0 }, - { X_OPCODE(31,597,0), X_MASK, {O_rD, O_rA, O_NB, 0}, - 0, "lswi", H_RA0_IS_0 }, - { X_OPCODE(31,598,0), X_MASK, {0}, - 0, "sync", 0 }, - { XO_OPCODE(31,104,1,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "nego", 0 }, - { XO_OPCODE(31,104,1,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "nego.", 0 }, - { XO_OPCODE(31,136,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfeo", 0 }, - { XO_OPCODE(31,136,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "subfeo.", 0 }, - { XO_OPCODE(31,138,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addeo", 0 }, - { XO_OPCODE(31,138,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addeo.", 0 }, - { X_OPCODE(31,659,0), X_MASK, {O_rD, O_rB, 0}, - 0, "mfsrin", 0 }, - { X_OPCODE(31,661,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stswx", H_RA0_IS_0 }, - { X_OPCODE(31,662,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "stwbrx", H_RA0_IS_0 }, - { XO_OPCODE(31,200,1,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfzeo", 0 }, - { XO_OPCODE(31,200,1,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfzeo.", 0 }, - { XO_OPCODE(31,202,1,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addzeo", 0 }, - { XO_OPCODE(31,202,1,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addzeo.", 0 }, - { X_OPCODE(31,725,0), X_MASK, {O_rS, O_rA, O_NB, 0}, - 0, "stswi", H_RA0_IS_0 }, - { XO_OPCODE(31,232,1,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfmeo", 0 }, - { XO_OPCODE(31,232,1,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "subfmeo.", 0 }, - { XO_OPCODE(31,234,1,0), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addmeo", 0 }, - { XO_OPCODE(31,234,1,1), XO_MASK, {O_rD, O_rA, O_OE, O_Rc, 0}, - 0, "addmeo.", 0 }, - { XO_OPCODE(31,235,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "mullwo", 0 }, - { XO_OPCODE(31,235,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "mullwo.", 0 }, - { XO_OPCODE(31,266,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addo", 0 }, - { XO_OPCODE(31,266,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "addo.", 0 }, - { X_OPCODE(31,790,0), X_MASK, {O_rD, O_rA, O_rB, 0}, - 0, "lhbrx", H_RA0_IS_0 }, - { X_OPCODE(31,792,0), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "sraw", 0 }, - { X_OPCODE(31,792,1), X_MASK, {O_rA, O_rS, O_rB, O_Rc, 0}, - 0, "sraw.", 0 }, - { X_OPCODE(31,824,0), X_MASK, {O_rA, O_rS, O_SH, O_Rc, 0}, - 0, "srawi", 0 }, - { X_OPCODE(31,824,1), X_MASK, {O_rA, O_rS, O_SH, O_Rc, 0}, - 0, "srawi.", 0 }, - { X_OPCODE(31,854,0), X_MASK, {0}, - 0, "eieio", 0 }, - { X_OPCODE(31,918,0), X_MASK, {O_rS, O_rA, O_rB, 0}, - 0, "sthbrx", H_RA0_IS_0 }, - { X_OPCODE(31,922,0), X_MASK, {O_rA, O_rS, O_Rc, 0}, - 0, "extsh", 0 }, - { X_OPCODE(31,922,1), X_MASK, {O_rA, O_rS, O_Rc, 0}, - 0, "extsh.", 0 }, - { X_OPCODE(31,954,0), X_MASK, {O_rA, O_rS, O_Rc, 0}, - 0, "extsb", 0 }, - { X_OPCODE(31,954,1), X_MASK, {O_rA, O_rS, O_Rc, 0}, - 0, "extsb.", 0 }, - { XO_OPCODE(31,459,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwuo", 0 }, - { XO_OPCODE(31,459,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwuo.", 0 }, - { X_OPCODE(31,978,0), X_MASK, {O_rB, 0}, - 0, "tlbld", 0 }, - { X_OPCODE(31,982,0), X_MASK, {O_rA, O_rB, 0}, - 0, "icbi", H_RA0_IS_0 }, - { XO_OPCODE(31,491,1,0), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwo", 0 }, - { XO_OPCODE(31,491,1,1), XO_MASK, {O_rD, O_rA, O_rB, O_OE, O_Rc, 0}, - 0, "divwo.", 0 }, - { X_OPCODE(31,1010,0), X_MASK, {O_rB, 0}, - 0, "tlbli", 0 }, - { X_OPCODE(31,1014,0), X_MASK, {O_rA, O_rB, 0}, - 0, "dcbz", H_RA0_IS_0 }, - { D_OPCODE(32), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lwz", H_RA0_IS_0 }, - { D_OPCODE(33), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lwzu", 0 }, - { D_OPCODE(34), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lbz", H_RA0_IS_0 }, - { D_OPCODE(35), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lbzu", 0 }, - { D_OPCODE(36), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "stw", H_RA0_IS_0 }, - { D_OPCODE(37), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "stwu", 0 }, - { D_OPCODE(38), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "stb", H_RA0_IS_0 }, - { D_OPCODE(39), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "stbu", 0 }, - { D_OPCODE(40), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lhz", H_RA0_IS_0 }, - { D_OPCODE(41), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lhzu", 0 }, - { D_OPCODE(42), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lha", H_RA0_IS_0 }, - { D_OPCODE(43), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lhau", 0 }, - { D_OPCODE(44), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "sth", H_RA0_IS_0 }, - { D_OPCODE(45), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "sthu", 0 }, - { D_OPCODE(46), D_MASK, {O_rD, O_d, O_rA, 0}, - 0, "lmw", H_RA0_IS_0 }, - { D_OPCODE(47), D_MASK, {O_rS, O_d, O_rA, 0}, - 0, "stmw", H_RA0_IS_0 }, -}; - -const unsigned int n_opcodes = sizeof(opcodes) / sizeof(opcodes[0]); - -struct spr_info spr_map[] = { - { SPR_XER, "XER" }, - { SPR_LR, "LR" }, - { SPR_CTR, "CTR" }, - { SPR_DSISR, "DSISR" }, - { SPR_DAR, "DAR" }, - { SPR_DEC, "DEC" }, - { SPR_SRR0, "SRR0" }, - { SPR_SRR1, "SRR1" }, - { SPR_EIE, "EIE" }, - { SPR_EID, "EID" }, - { SPR_CMPA, "CMPA" }, - { SPR_CMPB, "CMPB" }, - { SPR_CMPC, "CMPC" }, - { SPR_CMPD, "CMPD" }, - { SPR_ICR, "ICR" }, - { SPR_DER, "DER" }, - { SPR_COUNTA, "COUNTA" }, - { SPR_COUNTB, "COUNTB" }, - { SPR_CMPE, "CMPE" }, - { SPR_CMPF, "CMPF" }, - { SPR_CMPG, "CMPG" }, - { SPR_CMPH, "CMPH" }, - { SPR_LCTRL1, "LCTRL1" }, - { SPR_LCTRL2, "LCTRL2" }, - { SPR_ICTRL, "ICTRL" }, - { SPR_BAR, "BAR" }, - { SPR_USPRG0, "USPRG0" }, - { SPR_SPRG4_RO, "SPRG4_RO" }, - { SPR_SPRG5_RO, "SPRG5_RO" }, - { SPR_SPRG6_RO, "SPRG6_RO" }, - { SPR_SPRG7_RO, "SPRG7_RO" }, - { SPR_SPRG0, "SPRG0" }, - { SPR_SPRG1, "SPRG1" }, - { SPR_SPRG2, "SPRG2" }, - { SPR_SPRG3, "SPRG3" }, - { SPR_SPRG4, "SPRG4" }, - { SPR_SPRG5, "SPRG5" }, - { SPR_SPRG6, "SPRG6" }, - { SPR_SPRG7, "SPRG7" }, - { SPR_EAR, "EAR" }, - { SPR_TBL, "TBL" }, - { SPR_TBU, "TBU" }, - { SPR_IC_CST, "IC_CST" }, - { SPR_IC_ADR, "IC_ADR" }, - { SPR_IC_DAT, "IC_DAT" }, - { SPR_DC_CST, "DC_CST" }, - { SPR_DC_ADR, "DC_ADR" }, - { SPR_DC_DAT, "DC_DAT" }, - { SPR_DPDR, "DPDR" }, - { SPR_IMMR, "IMMR" }, - { SPR_MI_CTR, "MI_CTR" }, - { SPR_MI_AP, "MI_AP" }, - { SPR_MI_EPN, "MI_EPN" }, - { SPR_MI_TWC, "MI_TWC" }, - { SPR_MI_RPN, "MI_RPN" }, - { SPR_MD_CTR, "MD_CTR" }, - { SPR_M_CASID, "M_CASID" }, - { SPR_MD_AP, "MD_AP" }, - { SPR_MD_EPN, "MD_EPN" }, - { SPR_M_TWB, "M_TWB" }, - { SPR_MD_TWC, "MD_TWC" }, - { SPR_MD_RPN, "MD_RPN" }, - { SPR_M_TW, "M_TW" }, - { SPR_MI_DBCAM, "MI_DBCAM" }, - { SPR_MI_DBRAM0, "MI_DBRAM0" }, - { SPR_MI_DBRAM1, "MI_DBRAM1" }, - { SPR_MD_DBCAM, "MD_DBCAM" }, - { SPR_MD_DBRAM0, "MD_DBRAM0" }, - { SPR_MD_DBRAM1, "MD_DBRAM1" }, - { SPR_ZPR, "ZPR" }, - { SPR_PID, "PID" }, - { SPR_CCR0, "CCR0" }, - { SPR_IAC3, "IAC3" }, - { SPR_IAC4, "IAC4" }, - { SPR_DVC1, "DVC1" }, - { SPR_DVC2, "DVC2" }, - { SPR_SGR, "SGR" }, - { SPR_DCWR, "DCWR" }, - { SPR_SLER, "SLER" }, - { SPR_SU0R, "SU0R" }, - { SPR_DBCR1, "DBCR1" }, - { SPR_ICDBDR, "ICDBDR" }, - { SPR_ESR, "ESR" }, - { SPR_DEAR, "DEAR" }, - { SPR_EVPR, "EVPR" }, - { SPR_TSR, "TSR" }, - { SPR_TCR, "TCR" }, - { SPR_PIT, "PIT" }, - { SPR_SRR2, "SRR2" }, - { SPR_SRR3, "SRR3" }, - { SPR_DBSR, "DBSR" }, - { SPR_DBCR0, "DBCR0" }, - { SPR_IAC1, "IAC1" }, - { SPR_IAC2, "IAC2" }, - { SPR_DAC1, "DAC1" }, - { SPR_DAC2, "DAC2" }, - { SPR_DCCR, "DCCR" }, - { SPR_ICCR, "ICCR" }, -}; - -const unsigned int n_sprs = sizeof(spr_map) / sizeof(spr_map[0]); - -#endif - -/* - * Copyright (c) 2000 William L. Pitts and W. Gerald Hicks - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ diff --git a/include/bedbug/type.h b/include/bedbug/type.h deleted file mode 100644 index f7a719caf0..0000000000 --- a/include/bedbug/type.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _TYPE_BEDBUG_H -#define _TYPE_BEDBUG_H - -struct cmd_tbl; - -/* Supporting routines */ -int bedbug_puts (const char *); -int bedbug_init(void); -void bedbug860_init (void); -void do_bedbug_breakpoint (struct pt_regs *); -void bedbug_main_loop (unsigned long, struct pt_regs *); - - -typedef struct { - int hw_debug_enabled; - int stopped; - int current_bp; - struct pt_regs *regs; - - void (*do_break)(struct cmd_tbl *cmd, int flags, int argc, - char *const argv[]); - void (*break_isr) (struct pt_regs *); - int (*find_empty) (void); - int (*set) (int, unsigned long); - int (*clear) (int); -} CPU_DEBUG_CTX; - - -#endif /* _TYPE_BEDBUG_H */ diff --git a/post/lib_powerpc/string.c b/post/lib_powerpc/string.c index fc460ceb9f..0d8d280b27 100644 --- a/post/lib_powerpc/string.c +++ b/post/lib_powerpc/string.c @@ -26,7 +26,6 @@ extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2); extern void cpu_post_exec_04 (ulong *code, ulong op1, ulong op2, ulong op3, ulong op4); -#include int cpu_post_test_string (void) { int ret = 0; From patchwork Sat Jan 1 17:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574494 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=SHv8ru6O; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7sp3wcCz9tk2 for ; Sun, 2 Jan 2022 04:14:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7408381277; Sat, 1 Jan 2022 18:14:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="SHv8ru6O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 856EB82FB5; Sat, 1 Jan 2022 18:14:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DC61082F3E for ; Sat, 1 Jan 2022 18:14:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HEAAn018804; Sat, 1 Jan 2022 09:14:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=aQJ94tKxmt2EBppZZma0LWNEfww+ZTByVJ1ZUtnjs+0=; b=SHv8ru6OMkL5bT4VDjR/+rPfiNEe3BMi5tc/ckwvOXx8xHjBcajma3zUskeb5ZZy0v2+ r1BYPAwli1G2/YfMorOwcigpMuOihA5xNBJ2lzz9HggD0MtKBGaZTtFqzF2HZ/odnrO7 p8I/NIUjXcurGCMC6NHNKXYC962M1vWHCEusLYRkxlHKv/fWsU0xtLzgB9cUg7Y2n1U7 itkW4d6qZi058ChmheFM32xV4E1PO9VmQM8xKNk37je1qUJTFvFb6K9oov8UxU8aPLS1 6jZDICJ2iDN1GL5+9Dfz+tkxlA2xPvyDz/IqC2aqpGmsAQI69gR+eDeFstCHSgS4r2v/ tw== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2172.outbound.protection.outlook.com [104.47.73.172]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dak4705gk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 09:14:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ff0XVlOfl8srF7/sb1qysRZtezj4jkMTuST7BLn/vEMq21rQqOUmKnc74hV/tQCUmuCz/VYZLsh38x2BeReIV6ViddmBfALNVrTeTXdiGThd4Dup1IZA05QK33T1EIj3OsEml3FWPIEPuB1uOH0KCJloDv+l635ggoIp/VnRjgqaphHrJeV6uVMR0f/2IdJ/wFsgBo3qZL36MJV6E59xFIC6MZkmVXs5izYkW8LuYHQmnq7Z8BIRJM8n1pU1zqKMCOYXnA5WWTUSY2bJTf9pdidS9vjWB5FmujMyzbb9jw3UYgLo3yJajV11zkOQApIvSzb+4BcZrqjiKI/IrItPJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aQJ94tKxmt2EBppZZma0LWNEfww+ZTByVJ1ZUtnjs+0=; b=T+uF7PkEkm8UOf/MddtXawJHtsaLzPsGqi+bBL9MQSUOIKBm+Y+dpCbT9gueMKUo+FLWohO4oYWa5Z15qU1fwRygWC0mxrh5Q+JYV1udLrp3lZwAXUhR/+Xtsrjb5xPYJr+VPQ8S7cRdKwWsu8n7K+j6iBZEInJQ4t8IVJOUyNp70+PLQj0nVBrlzEYCGMCDjvhZ64LajPfrAAKcllJIm/dKIpQV1Ku+XR/GvHNJETA1Is/W3d997xg546Q8UaPht/8wMrahpprBlGGnxVsLy2eOnuC3Uf/km4bDu/nK7XO3uHuPZn43zkv8QzHJIIZy+sh9Usv/t4NPWZ1XCztDHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR1101MB2284.namprd11.prod.outlook.com (2603:10b6:4:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Sat, 1 Jan 2022 17:14:06 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:06 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Simon Glass , Bin Meng , Tim Harvey , Zong Li Subject: [PATCH v2 3/7] common: board_r: drop initr_kgdb wrapper Date: Sat, 1 Jan 2022 19:13:27 +0200 Message-Id: <20220101171332.2676936-3-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bead5869-ff97-454f-1858-08d9cd4a1dcd X-MS-TrafficTypeDiagnostic: DM5PR1101MB2284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BEhWvSjmQhMGBXrtrgfoe1dQO2UHeNeX3gYfgT7S7FOs6g4ze7T0XSMG9XACPVGlal2kO6HF2X0+FU9jp4hQ/9UBf/eF1PN+Ld2pPcpheog7731TPy8zl0DvF0gn7K7oGmuAJ8AmQPkG4hPgWXc36jnFxz3Qn5v5EeJhKU9arlIVdej+KIvboDj5lDHNq/WujbEFo54Y1I3kxtkQRqTY8w2bYNQ3MuKHRx5Ib+3i+HFjyFT6Ory6Xhu6YHwnrzDi3ZF/+zGDCnBNGzR5rlj+eKU5+q+r8kn0pQNoeKGtz+GEiwQofOIXmfDXDhQbCPwyRXtX0sainOofhGbdwnEyHZ6RFCMe2QsXflgXBL4Q+8zo14dJ6SiKVFZXm4pxP07bWk5Wrq7CVKZzOhPAzfrzTwm9nMk3lHZcl/mkgR6unSjdvP42JvBoWB46sjeReAx/uRYYIOa7raaLD3WaWdHCkFnuSs3lBgjHDpXXV6u4auXX6TDbTq0jIx+gxaZ7at9OHaoiv/joKxzN5ek3F8Ww7+raVOOGUy4ymZWGdP+9zogPSYsaMhalVGlJVYCQNzuc05AByeC5VNYgFB0W7bkN1jeXE01lLm9ekmi7soHAt+9s3Jzr0rSG4wuC6K2l3Nn36u7Uru0Vqslhnw5EmuOBEyvK4WzVqpp12n9U2mhPMcoFRjqKPfeJGnVw1rv3RfUBEh8jlEFu/69ojT509eEmxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(6506007)(44832011)(66476007)(66556008)(316002)(6666004)(8676002)(38100700002)(4326008)(54906003)(5660300002)(6486002)(508600001)(38350700002)(52116002)(1076003)(2906002)(8936002)(36756003)(186003)(2616005)(6512007)(86362001)(26005)(6916009)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hSFLQXNu4D14QjHtwjPlyMiZPOOgCf3u2ATyQtpTI6Qcfx5J4WhDpQ+GW4nVkXQCWmVHxgO+mUhwNR1Pnu8MZH+NNvcYd4M3JI0D2UbBmwuTSmzz4G+qX/uDzpfx96OfCOOA2j3AUXL7OxeIDybGJ3XKw2ja9JZnlBMP/upOdmh0UJhZxyhF7yz9DqFpH5fdbajxJGz9TJM7KZKNK7eDNDB+dajDWaK5oVMb7dSfQrkjUoyohZGVuFc9G7VBP08zh7AenV3Jn+AJWkPqrMz1IlHcs5vvUWAHSA0XDN5ERNxKu0Ttr1XHXhtOoqoi6xDhwN54lurC0KPcfbM0fgWXR3CNe6jZVB7xPw/EDwKsBySwsNfx06QDUhb8kvhO8pqrqjVLo6a0al9x3FEYCMwwLSnQJVmeXN1wWLQAFhZfGIYC95bwbOx8X5NeQpyyH3jOJ8jjj97oamWeEkFVLqfDE4gRNfVq/YPgJWLzMqmO7bXVeiCuTjeTdLgctiDh9kD87W6vRTfhbPZUuIanHgK50Tq2iGpGngXfMxSnXF49nMXpbjw6dsA9SqFwoNPweHK9Yxpv2O7T70Ubzau6bnABYGYr85IxxUQsqdZTQYzkjKQeSna2bQ9GNLwum9vHO3io1PjYF8sehkG9V4BJj9CXKWdE5JDy8W0HxZ9qTGklmUpLhvxPiw2legpV6X2qiKH39N4Cw+PzVn7ompPKeWVkVDv/VBjy7s0Dt11saCvsaFmuRl9yC5TlNt8CSbxx0xv3aZ/pLMGrw/zzWtrsGaN+xqY/lhL2eCiw1zZ++S/jmfWaeAYBvlQnelkz5oLrpUKZWCUhn4LzTA1VGOFsYMb6NTK/N19nzxt5zikrz+I4g4CngoqA7ESKuF7mCjibDChmvdnBXXWd42WV3pjkwEXTAl0M+HxrPH77/SPD7ILgUYPCaP6E/hEielj9xI5pCHeeZkvt9GFOKMMpjyjBXMwgYX2zJR1IfLobK8Tx3nGEqhMmIfyJEv16i+/KftI+61kbOUauG2iLK1sYxqmdTojO57zgL0BlaJGSHOap1zA2wEpoUAwz9UKl/58mw5HVqJmhDYh9lW51Y51SE5ES5eOGelYJq+SvNY1cm+P9C6mZX1sCyLlI5IF4KHvSGEYEmpnBK+hSP1G8lg7Bd+bqmS7yUolq/0PruZaXFyi6LsoHCt6ldJ2ip7gfdWpl7s+6Ir882a/Pl/4G8ZTmqFRJMLLIhiazpBd5af8mzwBjlj/6k/g30+M09priibUg3gB465wiOXgku1WGB1KKJOpeXR76kjlbVglx7kNzvY5uEiPK+aG/pnC1z2DEMw3qQmKdZa4Tn6OwNfSUmvg8gqRDFwkI2q06VPdQlSx3oPvKfU4h47tDq2jfuhjUqUNsH2IixZEM/4Q84hmsUNbMHa4aVMKvQQYPEl2swUSHwRmhQj6nsHpvloviTKk5cX98waGoM/I8EjlzJAcdWByJK3HlZBhe70O0+G5sIZoJDPP1HJezfziim7FwBcXYx0IXaib56nibmsUBWeJQ5S0tAvx/TIXm1culd0K6mdeSZMHkqYKf2WMxsa7p9MAaYAX1reL6ndA20KiGqSAaPO8NBFZTivvnOleI5bteRn5qU/mQGGueHYyYFJSJjSI1HqH/BUo5SGmXUHJMu65ozMuc5QWbRpVBZA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: bead5869-ff97-454f-1858-08d9cd4a1dcd X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:06.2752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vxfB17lu8U6PsJVFdrLpJaHSCMHT7YsFAzniP/l4TrkvqsgNI6gYEOFXXqibnCgO4YU+vacPoCzWPJJeucamje0YXTcElhNSb2uKc7K++1w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2284 X-Proofpoint-ORIG-GUID: eV0II8P-AU44Bw32oFkedP0j_qPfSmg- X-Proofpoint-GUID: eV0II8P-AU44Bw32oFkedP0j_qPfSmg- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxscore=0 clxscore=1011 impostorscore=0 mlxlogscore=581 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init(). Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Changes in v2: - drop extern and add function comment common/board_r.c | 11 +---------- common/kgdb.c | 7 +++++-- include/kgdb.h | 11 ++++++++++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index cc0e6fa92e..5905921caa 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -498,15 +498,6 @@ static int initr_ethaddr(void) } #endif /* CONFIG_CMD_NET */ -#ifdef CONFIG_CMD_KGDB -static int initr_kgdb(void) -{ - puts("KGDB: "); - kgdb_init(); - return 0; -} -#endif - #if defined(CONFIG_LED_STATUS) static int initr_status_led(void) { @@ -745,7 +736,7 @@ static init_fnc_t init_sequence_r[] = { #endif INIT_FUNC_WATCHDOG_RESET #ifdef CONFIG_CMD_KGDB - initr_kgdb, + kgdb_init, #endif interrupt_init, #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K) diff --git a/common/kgdb.c b/common/kgdb.c index 4493a15919..29b09fcfe5 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -527,15 +527,18 @@ handle_exception (struct pt_regs *regs) * kgdb_init must be called *after* the * monitor is relocated into ram */ -void -kgdb_init(void) +int kgdb_init(void) { + puts("KGDB: "); + kgdb_serial_init(); debugger_exception_handler = handle_exception; initialized = 1; putDebugStr("kgdb ready\n"); puts("ready\n"); + + return 0; } void diff --git a/include/kgdb.h b/include/kgdb.h index 616ce4451f..bdba347a7f 100644 --- a/include/kgdb.h +++ b/include/kgdb.h @@ -39,7 +39,16 @@ typedef kgdb_data; /* these functions are provided by the generic kgdb support */ -extern void kgdb_init(void); +/** + * kgdb_init() + * + * Perform initializations to allow debugging U-Boot with gdb over a serial + * link. It is called during the generic board init sequence. + * + * Return: 0 if OK + */ +int kgdb_init(void); + extern void kgdb_error(int); extern int kgdb_output_string(const char *, unsigned int); extern void breakpoint(void); From patchwork Sat Jan 1 17:13:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574495 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=bWwM4cW4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7ss3Mk3z9tk4 for ; Sun, 2 Jan 2022 04:14:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F18A82FB5; Sat, 1 Jan 2022 18:14:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="bWwM4cW4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BE5A82F91; Sat, 1 Jan 2022 18:14:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3389982F91 for ; Sat, 1 Jan 2022 18:14:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HEAAo018804; Sat, 1 Jan 2022 09:14:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=cfNLv93YPQjoZcUHcJHxK56mQ0Ypn1VI4I4UNth3upE=; b=bWwM4cW4OWOCz7mqVUSKJ2+aH0EXIf8TKnAd4ltdZyXZFG+ZiH07U2jt42Ocf7pq/D6t jbLq8dRejVVg7CW3NEJXrxOD8f3VK/kx9LUQhsG6X7sNd/HeH5NX95CQTva0ApQA6JCs fzkVqdOMzhDQgrjMsiuwAjlodqagc5duxkSxKTr3dyL63YLT6Nn1HpKm6EjzTh7JYRsY CGKenHGmFuDluZ0eY6YbcNSR8f1ilIxT5rxrE8RF9iM1LNkM+J9wh29i+1Nxfknlf6zq TUq4CX1DE8a/0O04zrvwHq/KdaRx1pZbMRSIDiJabCk1v7ZajF1sqYU1HqUKAsG8INN+ Yg== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2172.outbound.protection.outlook.com [104.47.73.172]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dak4705gk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 09:14:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwtA9+DoXHnRGpsheneYX1s515f97xAyV5fyrMx8sSc4MsBUJX7yucaBn9GcMWaMr8OH/PJWEZHxatuY1yylbt8FFkn3RP2Oq9xvm2DIBgs1b7TK8dz10VEC0hsgTzk2By3kMlUNWQLxxvWcccfnMv7sqq6kHqglu0gX2NIgb92VC1saC+uTnxLYxLVs5n3AfT65y/63v83OwfcGGlBisOmz+XO0vXvLeJOWytFE3hYaFSc4EPtnSJIXoyqZKBucvAuzuW4qSRuxsE6GrmyS7cYDGkRXRPgU4bL0aDSnXS8eJDgVpz4ZnoKpUAHmmhuG68UFXe8QAUN5twI9brTe8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cfNLv93YPQjoZcUHcJHxK56mQ0Ypn1VI4I4UNth3upE=; b=PO6VDvFd4l6y9h5FCQ+yXXaKiSUrr2X6rNDIHIk7vK57M0GtJ3RKkkMvSYkO3OSpehcwFf6ByFoherq36gBfiTamoyBRfk7mGacEskdKBKNhABQ5+4ASGMpBAJNdteeqmbWLisrk3MgxythAGA3F32uoqNs6NCWBnBSnL335ocYwbFpOXmVO9Qbon+YuP1zRsYKhdgwlKXKc/rLNapS+flnabZjc2JKz28SPyW9nKbzY0kEc13LYquBZtn6THoGPq76WeFJ8/ofOw0l7ksK3KIx383MvlakP4vlo8gdwjzAYJMStYpa4ZCHX9nVy/6vDZY7SM5JTpe2TJiGFKsumfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR1101MB2284.namprd11.prod.outlook.com (2603:10b6:4:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Sat, 1 Jan 2022 17:14:08 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:08 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Matthias Brugger , Simon Glass , Bin Meng , Priyanka Jain , Tim Harvey , Wolfgang Denk , Zong Li Subject: [PATCH v2 4/7] common: board_r: drop initr_addr_map wrapper Date: Sat, 1 Jan 2022 19:13:28 +0200 Message-Id: <20220101171332.2676936-4-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55e5c1f1-bf1d-4e6f-07d1-08d9cd4a1f54 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uo5eQqJbXtepLdDiJ4t9azWoBj8Qzh9rYOOQ33buuNNZAU/PzavTMw2daMB0N739QvFVYMbtBgQYidHsFSjquPkthBqBN6cntzxjlpxj9oCtMb0mcFTZGuqOsLit8LYBJHc6ItHxWQgE4OIwvfD883f38I2tMkgd27WqaJ7/MuJsOTt7HaehMxULdh3G5ZwflmN1ESgbUaHsVHIAEHo8YAnl0uTiikmW5bDO9VniV+t8puENj33DkdSMWcaFKBWAeromYiPzrQl0mtjPUnClI2vyUJmi7c+wj8RBiyyjQi6xthi7J1JXgVh6LkbGjz9c0W5frCrNktfjNnMwYw3yZlN6bFpzcGlLu7bvwujL/0qRFtsFqoDpE0Owmt574Ou5RpMIqBC6thkjweYC8AcwbMJjBUSr5/GCR0XmKtwSZZeqY7eM4snFfHmblb9O1stXQJLzs6SH9Q6lPXFzDT5unKulDn6l3ZBNyIC8bFEgoHdnuTEHYauLZLj3Ud6eH1znfE7rYZnmnFN98vtw92E4fY6MKWH6ZM1D97LoBG4uFTy1jNACdLdTvZasvvPOatZhTnmw1g44FMh+XdocooeDB7JDJb5cM5AXXJqpcasZVfJQHzPbLwluyKAtGZc2207SSNjCeORYImD+m+E+vKI6l4tJ6MLhuryia06W5QESc/sprzD7+Bbv19zu9vBpxxjkhbiCbJsogKcYBtVXaFNXSQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(6506007)(44832011)(66476007)(66556008)(316002)(6666004)(8676002)(38100700002)(4326008)(54906003)(5660300002)(6486002)(508600001)(38350700002)(52116002)(1076003)(2906002)(8936002)(36756003)(186003)(2616005)(6512007)(86362001)(26005)(6916009)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +mVhBOelyDSWEZrPxV6NnaFhDlyOXVm8mVdkm5Pl4jFcsdHjHBf9K5W4B33qvtlmLemLkFoXnABHasAAwLAoom8mD2ftj1ycCthbPGGR7jCV2580docT6pv19qbPD097HTkKHyTlxijESGC0wJD3A0Rd9K3XC/hRm5RAaaGdiaN8dlwNXX1aNDmIPtBwgV4SFDjviWVytHpwbasG8rSNzvl96vAeon5vB8jVZCA5sh8ymuQYPhf5hxuYCv+HsUyn8rEJLI9qQzkfoJ7xd2ORrrZJqvVbDz8WcHQhLwFjabAVsrQFYYxEDIlVflk479nIYJxsezhdj87oJlxQfvwCcbQD028AQQGbnQjoBKtx61upzk4ltUqef6scrutX+vEKxZ4rybb53UGdFnBMh4BxVpZGMHs0zU1CjwQ+5hZsNQY5HSFtOIYtB9owO4sGilw8/O7jxePJkDSTJbobIUt7acKajK9CLcvZKiD0cW8GBAjnI3PsjBTrdHl8lpGMmqGbILHAabcI0DdpY1ieqclxdUJ0UtPKZ4HeaBFAT61vFJa4iTq4TFzK4h2pJq1NswNbjAalgf8KLb9BhtvhyQyHrZGWSd0NdKvwWsn5yrprIDAp5wW5NfS4Xfcbd46IkxvTWFNxRuOfJeAKfyyUNBKOTuUKZB/ibzE/u2SS7dz1UZbBXbfcRUfAsLK19o/blpv04pLtiZT3ueEXWzQQjz1MLIdBU/2k/YQJVD65h1e/oeoojIHXp+0j3Qz3jAuazw8FoAqbRSwk49k0mOokyXxbCNVqi4Csetil8Ut0cPQe4AsLZPOL0iaYAenkUJ9odJiFhKVzw02Bggcw1FNK7cOZzolHoLcxTEgxc6db7krc8yZTA49uF8jPnQ21AyKhvgMEbWAWbtjj8/yv4D03xPSmgawuKGJtCZLViIbYBgjfYFPfAeAQVKPfxgAjd+WxRZIWUGQGr2S/D/gpCL5FutyaDltgvWJ9fysn6gwnp5wpbYX2iqLz3EObGjZrxbCmLFNJfSieeFkrXD0CKHjac4cOnABmFTtdx3+NyLQL2dB01ghpbBRZw4ongf71fAhdU0OoNiD3xV8fmHi4baAZ2RvTwdZ/vDROKHBv3CaL738xb/Mz9Sg41LM3Do/i2uxbFPJ6jZEcwfZYdTC3xIqQNueSl5OoA6whShX2lwpcw10WnE0EpL37530E8MPUR+hlJG7EY8mAtdIdnCUx29SdXc/S+17aN47GrJZb62fjaqHEF+RGi4eAU7FjYklwE9m34yO1We9gVlLqsh29kvGoUjlU9ndMpPRZVV3AWHpmBu708B1eJnfTaA5EhsS70eF1iulJmU/eqduIJlXcQJBKkigA0p3TgzacYkpciyKpL+RKh40KBVgxiqqNL7kwbn3upyGM5T2cRqlAW7c1Wf96Cyb/AWzTTYUJwNClBkwgye5aAsnm2L68VZ2NhLbN4kr/cbcc5ZCI9MvrK6OGOR/DBRcJE4l/c14gPuhKKj6YJGqbXjMWZBhJ/tAdTb4LeIDwCFRL0/mVoQNHPRTr6jmc9MY+yWmXpfLdUOtwCUs3bIYQwv0sTC6Eedxmihfk1jlso3gEfkwmSxJTY7zY7Um2Np5NFMoQcbbrJ1GHtO3thG9g+VLvDRN2vxB5jDp3Fxe4BIBDRNK+SVpsEKx4h8mkyOdtKw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55e5c1f1-bf1d-4e6f-07d1-08d9cd4a1f54 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:08.7916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PyMWFSxy4OPmP2iKVjhDSp34D3St4eEiz6HBH/C13RWU5tg8t8PqfMNjquSwGLT/ZtD9CRpz43t6p71dpRBbBZcbL5J3L/XVB6Z6Z/Z6DG0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2284 X-Proofpoint-ORIG-GUID: I-qv6QaF7SVOg44jJ3efF0KJaJIf86xe X-Proofpoint-GUID: I-qv6QaF7SVOg44jJ3efF0KJaJIf86xe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxscore=0 clxscore=1011 impostorscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Add a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Reviewed-by: Matthias Brugger Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/include/asm/mmu.h | 2 +- arch/arm/mach-bcm283x/init.c | 4 +++- arch/powerpc/cpu/mpc85xx/tlb.c | 4 ++-- arch/powerpc/include/asm/mmu.h | 2 +- common/board_r.c | 11 +---------- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 9ac16f599e..8449720fad 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h @@ -3,6 +3,6 @@ #ifndef __ASM_ARM_MMU_H #define __ASM_ARM_MMU_H -void init_addr_map(void); +int init_addr_map(void); #endif diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c index 9803499985..183650a90a 100644 --- a/arch/arm/mach-bcm283x/init.c +++ b/arch/arm/mach-bcm283x/init.c @@ -152,7 +152,7 @@ int mach_cpu_init(void) #include #include -void init_addr_map(void) +int init_addr_map(void) { mmu_set_region_dcache_behaviour_phys(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT, BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS, @@ -165,6 +165,8 @@ void init_addr_map(void) addrmap_set_entry(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT, BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS, BCM2711_RPI4_PCIE_XHCI_MMIO_SIZE, 1); + + return 0; } #endif diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index 973b6fbe4b..aa9b59d487 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -219,7 +219,7 @@ int find_tlb_idx(void *addr, u8 tlbsel) } #ifdef CONFIG_ADDR_MAP -void init_addr_map(void) +int init_addr_map(void) { int i; unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff; @@ -235,7 +235,7 @@ void init_addr_map(void) addrmap_set_entry(epn, rpn, TSIZE_TO_BYTES(tsize), i); } - return ; + return 0; } #endif diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 353dc4e874..cb5b26cd77 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -138,7 +138,7 @@ extern void _tlbie(unsigned long va); /* invalidate a TLB entry */ extern void _tlbia(void); /* invalidate all TLB entries */ #ifdef CONFIG_ADDR_MAP -extern void init_addr_map(void); +extern int init_addr_map(void); #endif typedef enum { diff --git a/common/board_r.c b/common/board_r.c index 5905921caa..b0840c70b2 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -186,15 +186,6 @@ __weak int arch_initr_trap(void) return 0; } -#ifdef CONFIG_ADDR_MAP -static int initr_addr_map(void) -{ - init_addr_map(); - - return 0; -} -#endif - #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) static int initr_unlock_ram_in_cache(void) { @@ -623,7 +614,7 @@ static init_fnc_t init_sequence_r[] = { initr_dm, #endif #ifdef CONFIG_ADDR_MAP - initr_addr_map, + init_addr_map, #endif #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \ defined(CONFIG_SANDBOX) From patchwork Sat Jan 1 17:13:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574499 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=MDnfrhaF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7tm11JRz9tk2 for ; Sun, 2 Jan 2022 04:15:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8E5881277; Sat, 1 Jan 2022 18:15:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="MDnfrhaF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8EB8982FB5; Sat, 1 Jan 2022 18:15:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EBF4D81277 for ; Sat, 1 Jan 2022 18:15:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HED0e012132; Sat, 1 Jan 2022 17:14:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=R91qelrT8MOQ4vUJ2BYDsaxzrIrcOKn+1vmYE6Ctz4w=; b=MDnfrhaFavaWP+A9lv5dRRy7t4dJouaMsOlBJ6kZpPq6/s3edaZgKzUnn5Fcunyl2xrk /qhp9c9YGTS0zDi2abXKwTodh8DBZf+fzdkyM7i9ju3tSAki075qwJqiLDKFGxKgDGv/ gb9C+6OfD0GJtojazdqbfVwrq57jsyQGcTnU6KI03LV8U3v2ad1/2gAYoFKFNLcWcyf2 /UUcUJe5Ey1FWVS98GakOcxFviCPi5vJEifuR7zPhnZeujyPuiDmp+riyykouxkWbnI+ qHhY6ntOp4bn9NyD9FoaviILgYU/MLQb2XDTf34UecGGWxumejFbOHESvGwkSo/UCJ49 zQ== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2174.outbound.protection.outlook.com [104.47.73.174]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dac6089vu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 17:14:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaygVslwaD54bbpdEQ3kRPdOAMX5jxiozlhmm0wONNl115I3uWPMCo+we7tZ7lU2nVBLEczol82MMmWHY/YM+qQDOZf63qZ1Me3aFJFJZTSlN/D6l2x0V2ulbmq2ejvJyOiWJSoCHbu+8ui9ixPBzzWnIr9kDNwCUrxeTCBH8jK6ZNdQwRckhJLe7DlZUClVCHXiLRsY4baBaZTk2RIdYv0AxGiSEryC9dKYLk5xbdudDHRJc5BAhg+8Hiww6w3rgHyyQjV5/6/AD0KmNOwUd2OG94sIKtawsQUdviMCJdo5f7OT46j7ubirsupNkbU05wbORa+znsFZhDbRpWn5uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R91qelrT8MOQ4vUJ2BYDsaxzrIrcOKn+1vmYE6Ctz4w=; b=dO96wVS+bTm/kVIfEh45SE6W9wCqJxcvcq5G4eWsJUFphOqFeev3vlqU++b4vS6zKpQynHkbRjzNctaCRr2QJ2BrKNITyxmRDzZv8KNPCzpM/bpkFroXGBOkR5ygxJ2k49tNodoVloiWDHRWX6+MEIf9hAuNXmdNYljsqUXUulm5Ar9OT3UTkt2NjoGZET95pARhL8uvnCeoPCPC5RsqCm063CUeDPQhbAII1PmhsmSnC/PUKK6vImTol+oArBiP6wIEEkh60W4fPy+VIXWD8VBRSSIk4siJFlkKUUAyFKjJqqgFTEwlHwZTyB9Blk6ExGc+VZVVh/M57etIMa+oeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR1101MB2284.namprd11.prod.outlook.com (2603:10b6:4:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Sat, 1 Jan 2022 17:14:11 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:11 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Simon Glass , Andy Shevchenko , Bin Meng , Daniel Schwierzeck , Matthias Brugger , Priyanka Jain , Tim Harvey , Wolfgang Denk , Zong Li Subject: [PATCH v2 5/7] common: board_r: move init_addr_map() to init.h Date: Sat, 1 Jan 2022 19:13:29 +0200 Message-Id: <20220101171332.2676936-5-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 54569416-9e4e-4a0e-7048-08d9cd4a20f0 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Bcac2tLD34dWv0gYuuvB3OWBr7PgFUQ98TwHrHKDf0GnMCrPZS0K5BBRcXGHu0TOLs7w3tirH/9Vni1J3G5c24S4UKdQMzsD8ST5AT7usOysJUs03tmS3BH316KZbHNLP0OaaUyvqNf/hA/TU2vQIRCh2WW2i415l0LPlNk1pjET47UfaMIMYZSkjbzk2ilXAgYB8V3sdDK0ZLBzu7zIXbqRY+K+ovAtaOpPedVwktmC3xQSo8w+yIgSE5H+plI1f3pUNcd7qGBTnA3jM5FnO033gGAYTnpmp0IFlXsg5yrvRsHixmSDStl+JpryB//DPPEJvU7H+4eoKAF4TZ4MRcxEAyhhsoMSZO2SQ27zIJ71ziqcR5fxawwrpliSicZ+ocxnz+QopjUtp6jXddnBm1hqn6GtiN3ZMPD5oNgmLVZBRkrOkyal/idXiiMFImCevF0RX6/q8IcFt1c5eFkCPwapSZ6ehwlRRQOUBEbI5MOR+k7CKdkawrsRGFj+D7WXxldJdlGpbqu6ucT3oIlXTFfLNgLIDjpOgxetu+4+plDifT5BBva8WyfeUtFe8Y+ydK3bI4SppmDCn8ZRoUKwD29rR5opzg/76xhKDhFvF9RxBa2mrG9rE/cm7DpECgFRcDy+WYctvNlbMM/uwslJGXaSEgrptGBRBp49TgthDf4x1Z5ibb/TIWw6GHfSsaTEKubHsaWxZIvCrNaFjulmA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(6506007)(44832011)(66476007)(66556008)(316002)(6666004)(8676002)(38100700002)(4326008)(54906003)(5660300002)(6486002)(508600001)(38350700002)(52116002)(1076003)(2906002)(8936002)(36756003)(186003)(2616005)(7416002)(6512007)(86362001)(26005)(6916009)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: or6poVgPPguU0S87Ir+/W0aHDN8GyiQRAzcI8kOGCwwmNEFwEHwA3dO+nINf658yL7vSqU3pUHxfeLAqg0hrMwVZg/6Jd4HiLTTwLFoJCmCKZmNx1c79q40wRu94uHcY8Cy1efWhJUMG4YQNtYkKSvgtrG5JArkA8IZzjYTYnuZVAsSfd4jV29OF0k31/FoLo8ZR9OIoJ+UWX10og0DSaErxXXWbNLtM7e1DCoXNEsRvME6WetNK/9cBEWxi+RiO8HG7Ngf7aKhQN4/AZlIRBO8JhV9+1iKfmCf+pA2nryGU1oCZtwNQyBDcfAOgHHxJ+HTVUe2I1suVnQeboFEzgDToJY9Lni/HxFPxv+cag/mvdhqXwSE5wbn220zc8kJxI9Jm/vwgbZ2EWvogX3ibAeRsVAr/yXK0akSyfi4Yc8DWdfB0aQWYwukz39u3LKlQxqbJFb0fchZy3Arjlw5sHltZwOpbReL7fzMckbBIgBAVzwoVjk9FgBEZxZ5Be6vA2KwVcoCj9T4+DUqO6lctYkKhsZBsnZcldt1tOgQLwD7TFugijTSC1fIgOekoEN7Fol/i8gfCBFbn1XaRiSmACD6J6SOZxagPPRMyjM/od0VOqChGieP8ruA7u3mLeDbOFhsmEoiIuEhraxsIi/J6FwFyOb6lmZ61WPB1oqLAok0cUb6zcrPaDXpiwnQ7RSmp1hmubyjOQCoct4Uzewb37OiQcKDeUMh5s/gzh3luJxI4JVjB3NbBo11uTwwoobQPN51Q0gGKwvM6dcHrIAyk5vpOH1iVUsrzmW4tve8m8aowJMUR2HyROmNL9KSU5nGEwTug5CBnJxujJJgDD5wSZaAMEXsWfXcchFhbGl9HQRbCf8tpBX+nfbJrEbaqhajsf6/f/Ve6YfKl9OjGuFMaBjY4AuDAnsTlDVBFQXln/3O7NkeqQcCSnf1v1HeuY0md1BYYKd1WAD9xSXpoPAQqtcQLVhT5kRz8mf8FxrBVfmH753KxvnSbPKt6rP0cFhroGgxrxxBuMLHEm2nsZkq5JsQ+HnhVWFbSn5zEqC9tnMwyPwBsTLj/EoPt5Wkhv0I09/aAHs7ms6jAT+frt3n7c8wl0IyfsofsvvCSXygx5dE7xyNz5uum5ryA6BOXx5up1IJtOfHEbm5scWnClGOo+LZlCjhfPTuZ0WU4McxucyR5HR2CXW/gnBToIrJZ5CNW/AKsLzBlRViolGXZ7eD5Y4XcHlxPMLdGFeRM3pNMdzCN6TqUo4d6a+jwdOvnKE2FnNMx0QeUCuLa6updOPuHNsrnd6Erw4PKagQjWbjEIqaZgL/KgMni35rjFfRChZLTaqz0z9wlvrw897UAVmoIz+AbY9MeR1xKaFtk051xfkVV2lUvHGXh4jKuC+qi0+cmca3Jwz+4OHvz9vbVbDyADd2kg969M4bKCn/w1nyCzaFZiQrvn5MyO2qjMpBHIrYlWwzx0TNAQZ23I4K11yfreH8Rulppxuwa7scElg++neazaoZXDkC9Q66gv9hLyphLBakTWghzu1txyBgIrqWStL4ttvqSIkje79Wl1CPYLhkfJ0X69Ug/P7HryZkx3lOnHEdYQT5d3FymxryToMVdy163Hi6duTszKPx6s1uxy4IP2LrM3wFt9vGxEwCClLa4hFAXNspfoaC0wdmpn6VLWA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54569416-9e4e-4a0e-7048-08d9cd4a20f0 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:11.5255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qp8AKFY5R4i3sSOlJROygAvDa52lx56CGsmc9/WoYoGNX4sY+SyUfMp9G97z9LJSeRaV9NzXRQoXOBAavSCAOBzFJ3L2GNkzLb6/B8BAz28= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2284 X-Proofpoint-ORIG-GUID: Nshp89L_mwZkUIXl3G64ug7Pqk6QIci- X-Proofpoint-GUID: Nshp89L_mwZkUIXl3G64ug7Pqk6QIci- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 bulkscore=0 clxscore=1011 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean asm/mmu.h include is currently guarded by CONFIG_ADDR_MAP ifdef because the header is only present on arm and powerpc. In order to remove the dependency on this header and the associated ifdef, move init_addr_map() declaration to init.h, since it is only called during the common init sequence. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) arch/arm/include/asm/mmu.h | 8 -------- arch/powerpc/cpu/mpc85xx/tlb.c | 1 + arch/powerpc/include/asm/mmu.h | 4 ---- board/freescale/common/fsl_chain_of_trust.c | 5 +---- common/board_r.c | 3 --- include/init.h | 10 ++++++++++ 6 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 arch/arm/include/asm/mmu.h diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h deleted file mode 100644 index 8449720fad..0000000000 --- a/arch/arm/include/asm/mmu.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ - -#ifndef __ASM_ARM_MMU_H -#define __ASM_ARM_MMU_H - -int init_addr_map(void); - -#endif diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index aa9b59d487..550d45da0e 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index cb5b26cd77..2e6255f0d6 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -137,10 +137,6 @@ typedef struct _MMU_context { extern void _tlbie(unsigned long va); /* invalidate a TLB entry */ extern void _tlbia(void); /* invalidate all TLB entries */ -#ifdef CONFIG_ADDR_MAP -extern int init_addr_map(void); -#endif - typedef enum { IBAT0 = 0, IBAT1, IBAT2, IBAT3, DBAT0, DBAT1, DBAT2, DBAT3, diff --git a/board/freescale/common/fsl_chain_of_trust.c b/board/freescale/common/fsl_chain_of_trust.c index cafb24971b..7ffb315bc9 100644 --- a/board/freescale/common/fsl_chain_of_trust.c +++ b/board/freescale/common/fsl_chain_of_trust.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -16,10 +17,6 @@ #include #endif -#ifdef CONFIG_ADDR_MAP -#include -#endif - #ifdef CONFIG_FSL_CORENET #include #endif diff --git a/common/board_r.c b/common/board_r.c index b0840c70b2..7c45e494ed 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -59,9 +59,6 @@ #ifdef CONFIG_XEN #include #endif -#ifdef CONFIG_ADDR_MAP -#include -#endif #include #include #include diff --git a/include/init.h b/include/init.h index f2cd46dead..d8278f1c00 100644 --- a/include/init.h +++ b/include/init.h @@ -307,6 +307,16 @@ int board_early_init_r(void); */ int arch_initr_trap(void); +/** + * init_addr_map() + * + * Initialize non-identity virtual-physical memory mappings for 32bit CPUs. + * It is called during the generic board init sequence, after relocation. + * + * Return: 0 if OK + */ +int init_addr_map(void); + /** * main_loop() - Enter the main loop of U-Boot * From patchwork Sat Jan 1 17:13:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574496 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=dP16pDsV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7t65HKtz9tk2 for ; Sun, 2 Jan 2022 04:14:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4957883039; Sat, 1 Jan 2022 18:14:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="dP16pDsV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C48638111F; Sat, 1 Jan 2022 18:14:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CFEFC811B2 for ; Sat, 1 Jan 2022 18:14:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HEFnk020463; Sat, 1 Jan 2022 17:14:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=6HpIBbdTmYT9rqB6MSRH4DeNONbtr3ZGJf+HBi3ezLQ=; b=dP16pDsVfZutf7ba3zKdlAmUQy7E6HNnfP2XOJNPTyqoMMD6VorplBln/DCEUuobEA4E iYfg2pxlj/GdgyZpaY4rv1ShZgE60bG9iNjuW9nrK11WqWGFPufDZLRgxqCiNtaHXaeg 0b6yuU21MGan/PAzJHdrLH+vRbJyCBwigjIR9SnnGLaXpUICmcb+x2rWYHBWIZrhCHvs 3PDev6ajn3JT1Cnv8rvG+O0qa4IWrctTQuPqekUAyqEKyETLhjQGGnVDniO6bqxWaQXc 9UHJnPytZxU/5fFYtlk/uHDVLJF1eNRtZ0GLCVqS2qAe9so1dp5gA+Dm+pxISsgo2qW8 Bw== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2172.outbound.protection.outlook.com [104.47.73.172]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dadx808rp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 17:14:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbSK6+0QjwLLlC3uARZlRFDUA6bZ1fL3PbtmRHyTeeuwXHD/1hBr8XeYIBaoJMrBlq+KCTOVCPJVrGIcAzLq+MkiyNtr25QYzwuP8s7rwaI/94QBOENiD5oynV7ehup26UXKwQDX+SF1jZwTPoVdNU7lPO/5uZ1kUSRiGCwlZBjBLD6eP6p/vh+TNCYM7m9x4HdbxFkKLo7N9AmFUIUdgInUUSTqGR+1eCSseEFBQjJIS5gQJj7jZh1sQIR0zDRh3kslfNi2k2LwwVhuffM+Ffbp/d+6Yl3YUzWB8QEubmPCJwcodzbaS3JXflWnTBwW7rOPFGpV4cLfB+btbk/kag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6HpIBbdTmYT9rqB6MSRH4DeNONbtr3ZGJf+HBi3ezLQ=; b=SasprNbBs4Q1dVn4EWv3U6OXScei1cuqMyTgRSFg4PFnSCpgys4FjDW6jfOIj+FPKlvkcNxBgASwxkoY0t5lPRqVpDjgwlxU9r3Tr3t4MptllpUxLOavWS1/pZq44xr2KXUizt+UHbpigJrmJKccljHhyGL+sL+YYw+nOgEmtMNVOfqWeGSSWQa2iAJZnPNXV7/7QTdWDkkDrfmhSxwe/fyTORJwwpXm8uVPUDHmhHupXdXhqrbAB6d6Ist5Qb5LVhKK+A+VKwM/hET2QMNlstwL7Az3qPra0/9b65/I/5LWC5oP6UpFR+O8BZdJVkf/BWnOrxKxL4ymNPK6jDhfjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR1101MB2284.namprd11.prod.outlook.com (2603:10b6:4:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Sat, 1 Jan 2022 17:14:13 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:13 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Simon Glass , Bin Meng , Rasmus Villemoes , Tim Harvey Subject: [PATCH v2 6/7] common: board_r: include asm-generic/gpio.h Date: Sat, 1 Jan 2022 19:13:30 +0200 Message-Id: <20220101171332.2676936-6-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45a9dbb1-5741-416c-cdbf-08d9cd4a2215 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S/58EIhrKlsb1Xtf3UUnVbJQzlJPnQiapxf/X+hIt7c3DlkBn7Dz48eWn3fec2aJsWm1Jiqhg/1uzQbAXrJakgP9qCi6WRdJHZRQaBZDEbs/Urihqwrrp8AM3w3n7iuvTSjVGj90vCaEHOu4g1DX7f/63nBQC79axrwLX6vMy8/3eQR1y/s//4d4F6WqpbL6nwxuXFxRI6+gOk2KZ1mvHkw2InGi4duaEZJtHbYqE8cIvFejHiwHdlTj+m2CFB0k3iFMZuIKqLnbttYwlPhqdBZoS9LxqC8eTErioPpLeRZTUYLzWdgEfHvHMApM2tHluokEOZ+xBcr7Nb33EttQfle7zgHBkmRXVBWpn0HFRxhVY0C4C5r/1LscU+6iiaZMU8MtvAbI5EixxyG3gZJg9NIS6qLdHoBCbQ+z0FMcEhzi+R5S+DTosAjmfmBdizw7s8dhSCFcexi2y5Jyyww3qK1rnHs4Eagml2Xx2MwHUC35yPbUYb5qvPJRYk6Yc5fCCY+jt1MLcibSQ2/t1EtYpBYVThdJyecHKmy/VUVY2UHqSK6ASo57+e8Yt+UpEkdwu24ka6kqewill8M46+P821vjwNyUF92RqDLKy1gUsehREVYMT/WG5olBW55RZerpXFOXcygNX9O4OFguH9/Vx+gf6oU5Ep7wag1fjEODAvSdbyuLSsck9xNxX+rjRC9t6elcFuTLTapzBg9BnzWX+/edEndzd0PcZSTuyC7SJZg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(6506007)(44832011)(4744005)(66476007)(66556008)(316002)(6666004)(8676002)(38100700002)(4326008)(54906003)(5660300002)(6486002)(508600001)(38350700002)(52116002)(1076003)(2906002)(8936002)(36756003)(186003)(2616005)(6512007)(86362001)(26005)(6916009)(83380400001)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /L0uJsvTmjCERUl2374U6RZPkUW4YsvCB97nH1pBv/LEOTcrXYTIlceraCvBrXgqaEbqeBiYfRE1oCnhj5regGYLHCYGJnPJrgBA+o9IF44vM33cCtDrNYsuetlp4AcnUJ81E0WoMYyduILpiyjUHiBoSdhVvsqaDlRk8d6yhnfhPEM/zLrbDbhJN4OvhgN7WfwuJJv4GyaffknBrnszfuGt+uBarxE+sGC73TVvjHuwzoXIZsKmH2/BQhnUiqTGDXwIslsW/6bHqSZE8D/2vPmSycUT0hkbigUX1pHcqSjEyGsrSCAcicYd0dSCZAIFSM+/XvwoLZe7qcRJmHRzD+7wiMX5thpTFut7LZhU3zcTzqEQU8jeCdUc+TnbkqMfjI8p0mWjc7oB1ie2VovaBIxGBVcvSXgK+LcwcUBlv3Pg/ePPgaHzFdd/vT7Gsy7Av/jA3tq12GQTHqHnep9Je4fHYeTHWnXFSQbH3X/VT7V9JgdgM0Fbu0f4fF0KpA+V59Tb5t/jZTbakFjIc9MtkiPAcmlRCJkxiqQH7ISVUOwcAuIAfcIGz7Ty12LvEXecTYyqIkElms7uZqATKXGl0iN6Pfd2GKyteyy/ye9C2zEYU2E8zpf0P94DL1xrsOGlyOFoyVFRzY6C+aXr1oeC6s7N0IYFfyXnvABmojGQo7g7Ew3zwF2AxqpVyXqqsdF+SM5XbGknqhxgb1HRKsT3bBLHuxqc5iXxrTtJ8c/YFqXFzaE8+EldYwrYVDyATwZ/j/JngsSBJxrLbuecyzmlndCm+dV/4tiH916atwAmTS7Dv8YTnuzu4hNwuOO4hSAxk+1RjTPdxAvRsd2WvsAkeWq28/BmI5FMLPwcgDy5xFM0wfmYC2cNSp/GSroOmR1V77VgLhnPCSY/yMku+qEilQIyujUEHeAj7SVjENBJIW9silspuxdP6H5Mr+TQ5T47EL+llv3jQSWQmOlpxZ2wEN7QF7kKTJarbzaWP/gxffuX4mKy3Rx5UEJn6i9ajZjnWu7KTJ3FwZNWCclKjYeHgHKpN+8LtLsbYG/3BPaNDjhxGvZeHxsCXN94z/PtNIzZ6IGXs5yEeIoap8JuwGmpvFYQ186Ro3lBgGhFayKAeEu6IUfKp9bS9y3OE0yCPSXgSZj3OZLQcMF1wOnX1R6slMk9SE48g2rPnYndpZbmKRDleVwNMkl8eItaAhn83VOIbTcOygc2+1KGZjNJEoxjALMnY78x09xGatDEoQGiWNyK2UKfjwUjGxk+dpVQRvDopEf6zIOWwf4Hv5NYEH1IYUwqqFABmXBkApmrjWMfSh6+0OcoFL7kOF1WnxUd5EtWK0+67uAamP3sIOUzUooEnSTpEi2/PkSg8TOUXYfcYrmuXjp1/UTVUTKSYUZaFWKkJe+BPfbrL2aZBQAYwd0lRLLevz0ew7mr0mQav439kLnBPx82BP5hUBJLZg91+2UApU2/pa4reEO1NsxqgpR6L5Cckr31+oMRP8CuSkD35C8esDYUh9sX2Tj/PeSv605LOWUBm7RA+FYh2JyY8bBPiypzAoUNiJg+r9U9Q75ZE6CV+ZUX3ptU2cc8ahEuCTRypfu3LLP7Bst/0THNp5FybT2dr986VpWFgELGqMwr4+Hv1R18qB21oOvoBrv+EEC7dHrMhVBy97VKpMdXGbNckg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45a9dbb1-5741-416c-cdbf-08d9cd4a2215 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:13.5419 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t1QCledU9rtR5vc8zw2QYgNMgi3oZ8IZ6enVDasGef5S/Xa8v64eSv+JZ7acOyhfg1j77pbUaKzAFMLxSwqBGwwWk/5dfvnAMidnaDs62CM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2284 X-Proofpoint-GUID: OuAD2OD9LHtgHh8mswxoePQ1da3uSJTH X-Proofpoint-ORIG-GUID: OuAD2OD9LHtgHh8mswxoePQ1da3uSJTH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=572 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Not all architectures define and even on those that do, the header cannot be included for all boards without causing various build failures. Since common/board_r.c only needs gpio_hog_probe_all() declaration, include and drop the associated ifdef. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) common/board_r.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 7c45e494ed..be225d8f87 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -66,9 +66,7 @@ #include #include #include -#if defined(CONFIG_GPIO_HOG) -#include -#endif +#include #ifdef CONFIG_EFI_SETUP_EARLY #include #endif From patchwork Sat Jan 1 17:13:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1574498 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.a=rsa-sha256 header.s=PPS06212021 header.b=A37SfCsO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JR7tW1D0rz9tk2 for ; Sun, 2 Jan 2022 04:15:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB5B3830AD; Sat, 1 Jan 2022 18:14:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=windriver.com header.i=@windriver.com header.b="A37SfCsO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F22F82FB5; Sat, 1 Jan 2022 18:14:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D115E8141E for ; Sat, 1 Jan 2022 18:14:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=800048d64d=ovidiu.panait@windriver.com Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 201HEHto020792; Sat, 1 Jan 2022 17:14:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=DbtSMF3WNdemInDV+ikgxDtdxOZSOT9fasVlOCcwGhE=; b=A37SfCsOfLFOHn9WlfT8D/ie5ZjpxkS6aw9ut+pXQBQNB7fuLB42Oj2T3CIISGn56Ylb QKSNtdhyXe5u9/7+gpcVKjT32FMccboZg+2As3rth3kLZMVdzwmTaelDGKJM6f3epoqH S32r7X2xbivUL34onb3SCWcDMwwft7RWD5MgNzYeizEV2b7GnzLeub4yCIPTh17K9D/h UtuG129Gz5DnTPcTfHNWIKoMgfiNZQeAloN9xT8GfUaD/YD+LMXZkS87yoRvtLc1OXAG Jv1rpYL8UdO7evLbUaUv36IJVtEzDSGaxgEOMN4RjyUGtO8JAFp68vPJ5kvZlxv8B+W6 uw== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2170.outbound.protection.outlook.com [104.47.73.170]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3dadx808rq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Jan 2022 17:14:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZG90e9uKI5EMLugFmoQIJujEXqEDqezKm8pbklMEaD5ZTKMb0GuohbTnOuL1n/bgQU/6qTc6uqNHn7GOco8qgI0vAikLXgvO/afjNX8um0GgqgoUWBqjD3GyOM6xis4n2eug0Cty2s6d5KxgpkjrysLy72oi6hwFi0mv02nLhk4qslBsr0p+jfSddLnh3Hgya/rojUsWnmjrHzpGQGrISKEh49yPEL0dvxcvNhPeLiKPU4FXIrxcKE7cMLv9syJqVni+q0cC3PU6hQ8Rs/HAAZqJ7mMUXe6HYgB93Jrq3V7FLvK1oCkygUaIBdo2xf9xGgccn6V3QrBQ8o5mE1HxAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DbtSMF3WNdemInDV+ikgxDtdxOZSOT9fasVlOCcwGhE=; b=JNejnAp/Am7swCDIngc3E8ZzMJQCLPDLw2jtQWu9PAukr7aC/hzw/6hnImHvYBxORTvRKVGa4Hxo61midhOOm/T3lVjiMgddsZ65zpQe0+6xHDnpzocvVRLLOEeogrBExbQEMa62OEsiiR3/+1/Z2RZE1enALBaSmR3UQj+FjvTdIheIXPC1uY5VQ6HOos+9yBmugmq0Ppamf7iIX1RZJqPlqLJ3CQJkgQkJDaGJI6go+vE2tk32/c5uaPKASCnmR96ivfY0xXPY88v6Hbkr9u9Qx9G8bmJPPwu3JJHWDNY3eJ+l/mbV0/CvEaK/Z5daIpd6/tJ1lQaVMvtSQ6G6dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by DM5PR1101MB2284.namprd11.prod.outlook.com (2603:10b6:4:58::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Sat, 1 Jan 2022 17:14:15 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::7d5a:c35:1ddb:11f3%8]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 17:14:15 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: Ovidiu Panait , Simon Glass , Bin Meng , Tim Harvey , Zong Li Subject: [PATCH v2 7/7] common: board_r: drop ifdefs around header includes Date: Sat, 1 Jan 2022 19:13:31 +0200 Message-Id: <20220101171332.2676936-7-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com> References: <20220101171332.2676936-1-ovidiu.panait@windriver.com> X-ClientProxiedBy: VI1PR0801CA0071.eurprd08.prod.outlook.com (2603:10a6:800:7d::15) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45632bb2-66ad-425c-87c5-08d9cd4a2342 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZLPUizzigRYsxU0ll0eDj6XAMnutI0c2EDyiAtlXYGLN04AuWV6bU/a3xW0DBGq0xbxXyyZRQ4lYmPqf2KUyWZ1qqKXNGXkkkIcrTKs6FuTq4Zn6G/g9MIN9S7isXui0HiIslN+TwcXqgOnmOr5pK7i9B0aDnIiaBPlnuzTt9a8wuhEdZCWUdcm4FVAFevx/CpJFPgrDAfBKd9ftETTQXKeedClqpbPa5R4fvYaADBPEXQy3ANll29xPbsVWAKbrpg+F6vbQayMKjXuOBsDCY7BgUpJXzLtbKx70bhxkHAr2jAz5GGN4UeKOfr1nuhlBGj5NJHx6ZG5Yep1VyTqOM3CnHxzKUtzyBb4ydhkc4Yn1+QQa7lJshWh47vA7uE11ATAE5FQKY64h5zwqxxeZL9YdDs+69Lxns8E4/d/Er5l8Xm/IjaA8TmlCfnEQKkrCIFfI5jBSi9O9NuhQDE3k2rmzE+XSLk0YRURgvM7IOTIsIj06ZTw4gjlxPv72KVs3iO+mxQvn/+5ju58CCOYUjYr/4nBHUejDdJQrN6ttTZjsZ1ujI51fHyIocBNBK58s1CM9jmE961isWyyj+XB98PuEj2FKFaqfv8SFPKkA496ARz+VOCJN5eAI3bdH0Jg7MVVHVL4LrjbRUg094Pl+eKpe1Wypkx0lZFyV54qZ0fmYOWTepzYuuM17MKYqtqiQMNZJ7Et+Qhz+5iNBdj8mQA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5327.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(6506007)(44832011)(66476007)(66556008)(316002)(6666004)(8676002)(38100700002)(4326008)(54906003)(5660300002)(6486002)(508600001)(38350700002)(52116002)(1076003)(2906002)(8936002)(36756003)(186003)(2616005)(6512007)(86362001)(26005)(6916009)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r7S6xNCWkQGFx2rS/RzWhjReZC5Z/q1fXXWnc1YIK6xvRodI2jBeMkiA0nw3rta4TIkxsEr6/SoA53BGKLE2GEpO7EPQVAlgdHSGMHKAxW8AwHEKYvIDf69zJ4JtKAQkt2K05wJLh28J4mInAe2lzF92q9siZ8Ae8fJXJ6vYy0tYCi7LvS+Sgbl0MmQpXU1QKTWf41O4EhZLFuF4oyQ6eYM2VcmoEf6cBUu8K35QpDss4NRgFzGMOVngxjGzqNGQhhVnblTLqf4iYl+JuvVMoLDxTsIpBX8I7bHDk4vy9Nbak/Is+BCxlMLNxfkMXD5PaGsKyzt9C3iKHK2B6t0M2xFwFCWRZp6ZLyeU4Uuac2577WqCePdDEzL4UZI+avIj6v+7QiqORcp2aUXqM7de0ZvDtNqXJ+d+GwOwe5N5tpx9K2aM+Jr8KlJF+Lk9K/CCvAIH/UCANiz4cCS/dDBuB9UaQ/oGwUYq0L/zoN87NtnvNp5nbSSeQ8TXlSN5a6bkzxDOKy5RnrfLegQhQiS0uWSW2qRv8oLKzgdBz4XwTPZdZulJ8ZxOqPBqJjNJQG8iQEvy3Q8dyMc7iZmCB+ZWdYtMV3zy5YbocnHFyKgJG/nd7eOlxL6t70e2+zuKpxRcAYZexkC9pUXI/jV5YWrm6xaZ8iPKqDi1cPvJZsncNghOIyXcNozIGynsN8vgHQDJNXlTBnPaQaXFjY5YKAfjJ/DEYr4q7/kg6fbrTn/h0PtMyT73I2kLah/WL1oKyIFmFFZExHHJmiu5A0ivCyZHwkXMJNTPVdjj3j6eYbBsG5A3qmvJ3CjOr7UbeqMqCUgT+sTG3fDDG18/8ygMfaqNqq09vKYdWzA1heS+Z82uvu1Ixkol1kVQg/gnsXgctGnrxM+Rs+pd1UQp/A/6b94Y6T8vrhI4OjqC9pbTqOs83cf8DSGbaLdWaQ38MhH762sZ30qg5nR5OPI0cGsz+u1OE0pOjG4J18IRydYWvom1WzQFxbRvdCdOop6ukXkgUqqkBAXG9t4zWd+vNEm4NKksfGHW7gm1fzpPN4IXO6B7INXQGTrXpjECIWu81HAPSJFVe6BvdZBb5DnX2yOSmkTB0jO+mWa/ls+BjET5GTW9+AEcKE7v2CC/rhbLJBgVwIUA0OeJi/apB48YiKv9J34FyPgqSrgw/hKvmEF2GEUewucveIO7Bd7vBtzcexgwvJn8BNKHH1yRnDrmVSO1QUlz63USNiYgDDIqEifc1IRAVwEDaV5nMGbgTGrUd9HGPijlkQhHhhNW6AZye5y5vGpFuf2eOZUzNAkrIUBgMkRMYdl1W/MxbcYCCaSzVktnfXB+ndn9S0W7vJydRDE4tqxEfQQ01n+r0/Z3Fhdhirkf/0y0DC5lbA2O4l1qGQj6rTIvNStev5mm5HWsL2FWRVgWby1pAv2AQWLnjBTRsYhn+KWxoHTtBSWMdviVwt0JTdIET/PSxxjNtEM/SN10hx8OqThlthBIBJ6BLVwyVkdZcBwcrvhMR3ml7d6x3i6eaeXn3IP3Q9cFzDVbK/oL0q3WfdLtrwla4aX1HmC+8UjplamHfVlE0LQf8ceX7Hf7JLQvRvglD0X5+C7frJJuV5h826f//VBevU5qVt6Fy2ZwdfsaSdfinbPBPx2sg6AJicMb0tU+F7jsSDZFslO3R1b7vw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45632bb2-66ad-425c-87c5-08d9cd4a2342 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 17:14:15.6221 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OPXG5S0HbEQisqUZhtp5zs/l/H9ZlvNFfAskQmwonHWBCaTfPKzRFlTg/YTYMw0aWY8ZhKr7yQa/fEl/dVPjzquZfMWRBxzXPJQ2FO4DnKE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2284 X-Proofpoint-GUID: ujHThaYBPGVM65UaFMNpFeBd7Jv78cnU X-Proofpoint-ORIG-GUID: ujHThaYBPGVM65UaFMNpFeBd7Jv78cnU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-01_02,2022-01-01_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=773 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201010054 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Drop the remaining ifdefs around header includes, to fix an old TODO. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- (no changes since v1) common/board_r.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index be225d8f87..bac386f021 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -33,16 +33,11 @@ #include #include #include -/* TODO: can we just include all these headers whether needed or not? */ -#if defined(CONFIG_CMD_KGDB) #include -#endif #include #include #include -#ifdef CONFIG_BITBANGMII #include -#endif #include #include #include @@ -56,9 +51,7 @@ #include #include #include -#ifdef CONFIG_XEN #include -#endif #include #include #include @@ -67,9 +60,7 @@ #include #include #include -#ifdef CONFIG_EFI_SETUP_EARLY #include -#endif DECLARE_GLOBAL_DATA_PTR;