From patchwork Sat Oct 22 12:51:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Lapshin X-Patchwork-Id: 531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1191137wrr; Sat, 22 Oct 2022 05:51:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zYovDiAL7pyy40aHpPpoiUb3m4Z/uBEj8pLm/hg/asahAvdwuugRaJF2qfMwyzB1gDurD X-Received: by 2002:a17:907:78d:b0:740:33e1:998 with SMTP id xd13-20020a170907078d00b0074033e10998mr20313468ejb.162.1666443092527; Sat, 22 Oct 2022 05:51:32 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r7-20020a05640251c700b0045d523bee48si20886751edd.178.2022.10.22.05.51.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 05:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=CpFFlmnX; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D4003858422 for ; Sat, 22 Oct 2022 12:51:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D4003858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666443091; bh=n9rUKThKDEXwaHbMmSF7+OvbS3Mbov5tvpHiP9Ov+fc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=CpFFlmnX6Nc5lMYh2fWxroF3zKG5rznxAPuxGFxPeeOHDWQSJVQa15i02l0QUYID5 1V5IL8JCAEnpmrlicY8bqe+1mLSk0kfzJLezJl4+nI1VdVpDmcTjUE+e1GKRKnp5eF 1qh8zg6QIbB5N3IbA3DnYgmqIZ6FRZ7BH5UHwwJo= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2122.outbound.protection.outlook.com [40.107.215.122]) by sourceware.org (Postfix) with ESMTPS id B6BA53858CDA for ; Sat, 22 Oct 2022 12:51:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6BA53858CDA ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y+btxatX8GNXwQBhdvx6M5xs2f3aEU1bcpoVvRRypDJA6UVlKAB9H2o4+0TcVuqBBRfEUQe8CuG4eEROnxbKSKo9ZIqSPV5jmnC+3CgVrStJdmO2gKTZDY2WDNo6cNJivkpKLvfV8MdEHcaXvacNHFWRNVRVFHUIdKpT0X7jDsF+myYFSQPmmtQ3Xjo1E72FP64jjWLburwyROTV3C+7iOmzvo7FdnI+fY8jU5OOqrQtNrgHI50IeAc63woQj8YKhAxJ06eLmGfvhS3iYJyDXuyroODiTSiclEoPEix9ytEN2Azyp97ybssk5lax80RKBSCXxXo2nfF0oV4weXXUOw== 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=n9rUKThKDEXwaHbMmSF7+OvbS3Mbov5tvpHiP9Ov+fc=; b=iTPBUjVyA0YJTSlkVFAnCpmnjEdowZRy7WAZhAJCnLPtuybZRB2URf6LxofWgyTr3vbVhGh27jCEZhwHVHuFn1ZPX0prpSaodch/NZEINLoWigbd+p5M+P40X5cdObuAThHK+BvnFi3ieECceMts0C51i+AJPMJOLHRgEEpDc632PBU1UqlWrzy7wH1hz5TTC1PLSs3LorftL79lulJzleODxHoc77xCwD+YrhR3NpuVJmESWZ7UQSvqzsJRdClqxIhT8fsn52tdEqIhBEnekU6LxMYPd8vonzb4PLeXuvVQ4Nv4O7Oe9hh+00wJYyIydUE2DnXRXq428VlHScYpJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=espressif.com; dmarc=pass action=none header.from=espressif.com; dkim=pass header.d=espressif.com; arc=none Received: from TYZPR04MB5736.apcprd04.prod.outlook.com (2603:1096:400:1fa::7) by SEYPR04MB5908.apcprd04.prod.outlook.com (2603:1096:101:68::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Sat, 22 Oct 2022 12:51:13 +0000 Received: from TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::e64d:5c85:a83c:5898]) by TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::e64d:5c85:a83c:5898%4]) with mapi id 15.20.5723.032; Sat, 22 Oct 2022 12:51:12 +0000 To: "binutils@sourceware.org" Subject: [PATCH 0/5] Add Xtensa ESP chips support Thread-Topic: [PATCH 0/5] Add Xtensa ESP chips support Thread-Index: AQHY5hT3GbZU/yAoy06UmDq+62memA== Date: Sat, 22 Oct 2022 12:51:12 +0000 Message-ID: <94fd668465b77e94f3c000982c694e7da8f828f1.camel@espressif.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR04MB5736:EE_|SEYPR04MB5908:EE_ x-ms-office365-filtering-correlation-id: acf36cc0-be1c-4348-3c34-08dab42c1988 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GXJZZFsI9B1fm+Y7FwnkTkgoHjRJ3GYJZFjchm2Tbk05NbI/x9aJknKyHmUaNK5y2GirBSX188XhhBTK0EbLaC6a85JsqpmRioLzAHTS+9bmbyYGvqqquBKzHTnstLNGYuG+YRhj9Ah26X3F7nPhHLQq4onUEWSKzqBw2QNxwmB04k4/Vfvpax/7vNpb5mmYuDFw7vFVoSl7XWkkfQwHJHFh+G3awiynDHyH0dV5rfRb0M9G4kbbY/V3zdRc5GCR/yx/CUa7YsVNe5UdSZp1TsxiteIZD/Nm6AehL4AzH27H7F9faJ3Z+wQRq+pOVLh/40yVO7oKXQCDlZw0SJaheXyG/3Lclx5Fyu1FC0uTTlcb76R53oRUKuOHagNmFroymQUfnxAIaLQ0emf2jz5kg6UYv4pNQzLpAZ6Anz/6z5z157EtOb0UcrFWRH8+yBTJtd28+/j4XJZi1TFOPgq2qHvzZminLPtsorvEIDhcn5kt4EBiDyUos1ZjcBhnrVbPhRTSOCS3fL1nWYLOP7w5AYHRKXdRAP0sw3CZzmeqw7pncBaIuK5f9+T44CCN9uEUa/67Cx4X+SQIMXeJPFkmja06jOKEvVVz2IVRxO5k4Ka0QytGY189HsNqb07j/6/JR2XPMxP76vfEcj2g1Tyw+ziih/OEyi2PtddLvUqnOVjmMsBDfPGDHucmmrQxRfUKrmqGH/djFYApStKV3YG1XjUNSdV2ArAFqw7UkH3a2QLsTgR3+A/7zlBN26dYj4iuRhXhgAZ2lIqt0Zkc7T7gDk/97ltt1ACZKRrrx+3o41k= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB5736.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(39840400004)(136003)(366004)(396003)(346002)(451199015)(91956017)(2906002)(107886003)(8676002)(38070700005)(5660300002)(76116006)(4326008)(66476007)(66446008)(6506007)(122000001)(54906003)(66556008)(6916009)(38100700002)(64756008)(66946007)(86362001)(83380400001)(6512007)(8936002)(26005)(36756003)(41300700001)(186003)(2616005)(6486002)(44832011)(478600001)(316002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?cnZJ106RuNVpeZlf6p92N4tbn1tH?= =?utf-8?q?aQ2fDVvmeAC6eMK1VdySy2wG66KjQ5Kdw5hnKLoNF59thViIenWlhs8eu3qjVWdiP?= =?utf-8?q?pyCIIxCN5aclcC71JAhSt70Nq6Ldvkbr0mlqEuYUOoWUCGNcHCy05fDWnNVbxYgmH?= =?utf-8?q?6Rp+MZXIDw4KXWBxo6riqcowSpAqeo09ux4CQU97iMmRz8UbMjw2H+sEr5u5eR18T?= =?utf-8?q?4YEKyuU2/o7mokGsl9xmiwkTTkbkHoHKbu8N0s6Yt3ZZjbje0gdxi6ULziV4BhAvU?= =?utf-8?q?QXrtaY2/9Qd7c9iqeN8oLk2ahS5cllJA3m+Q4Ht/S5EVyjwsTWzkit7r7rlWCWjbc?= =?utf-8?q?FgPaQmA1GbG/r5KYc4ogy5C6elgiN6H2qCRI+ufu+s7rZ3G5sOFiSKfzdXYkCOKfs?= =?utf-8?q?mtHrugbIgjeafbdlgswlgWo8mKF8hR01bIQJ3mrna3Ug6hOBheKIUY4MtJ5ezq5MQ?= =?utf-8?q?oZdB6of8RkxTUEY9kVRUfb8zoIJkQlXXgCz28PaZq+QHsR5Lz5kzEuxGY1gl0SC1G?= =?utf-8?q?FEoqWN4fJh9lYH1uBriooB34JzSLM5ulZcuNDA5YBIlRa7KS86m64JTJVm7WOAeCC?= =?utf-8?q?3FiDo+B0NfRuDPpNtsCx/6ab9yNXMXJwkH81Hjs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OUxFpZX0+t8lNGUMEOJj?= =?utf-8?q?R8PgZdhWL0iltRu90u02cd3MlFZBsgRS3z6Y8K+CDEEztmJQGJccfC4=3D?= Content-ID: <1499ED482582F14AA28D0B495C7C64D4@apcprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: espressif.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB5736.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: acf36cc0-be1c-4348-3c34-08dab42c1988 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2022 12:51:12.5797 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5faf27fd-3557-4294-9545-8ea74a409f39 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: G2n5s1LRIk2TRQRu7295sUS6UVXGQKJ6HdnrKMHaVEdCeUM6whGwxsGGULv9ffWk1R03roT4h7VY6vsxn66o++0E2Qsag/KOhVO+MucELJg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB5908 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alexey Lapshin via Binutils From: Alexey Lapshin Reply-To: Alexey Lapshin Cc: Anton Maklakov , Alexey Gerenkov , Ivan Grokhotkov Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747392232479346769?= X-GMAIL-MSGID: =?utf-8?q?1747392232479346769?= Since ESP chips are getting more and more popular for developers I would like to suggest these patches to consider to include Xtensa ESP chips support for binutils and gdb. The chips support was done in a not common binutils way. There are a few reasons for that: As I know, the Xtensa specific code for binutils and gdb is generated with tools from Tensilica Inc. To build binutils and gdb with other chip presets we need to override some related files (https://github.com/espressif/xtensa-overlays). To make it easy to integrate new chips I did refactor the code a bit to make a possibility to just copy and paste Tensilica-generated files and modify a few lines in a code to make it supported in binutils and gdb. Please consider these changes to merge, I believe this could be a pretty improvement to extend supported CPUs without using third-party sources patches. Alexey Lapshin (5): bfd: xtensa: move common code from ld and gas gas: xtensa: add endianness, loops, booleans options ld: xtensa: use default LD command line options to specify endianness gas: xtensa: add esp32, esp32s2, esp32s3 isa-modules options gdb: xtensa: add support for esp32, esp32s2, esp32s3 isa-modules bfd/Makefile.am | 10 +- bfd/Makefile.in | 15 +- bfd/configure | 4 +- bfd/configure.ac | 4 +- bfd/elf32-xtensa.c | 126 + ...nsa-modules.c => xtensa-default-modules.c} | 2 +- bfd/xtensa-esp32-modules.c | 19191 +++++++ bfd/xtensa-esp32s2-modules.c | 11671 +++++ bfd/xtensa-esp32s3-modules.c | 43674 ++++++++++++++++ bfd/xtensa-isa.c | 25 +- gas/config/tc-xtensa.c | 79 +- gas/config/tc-xtensa.h | 2 +- gas/config/xtensa-relax.c | 8 +- gdb/Makefile.in | 10 +- gdb/configure.tgt | 2 +- ...tensa-config.c => xtensa-config-default.c} | 66 +- gdb/xtensa-config-esp32.c | 389 + gdb/xtensa-config-esp32s2.c | 271 + gdb/xtensa-config-esp32s3.c | 496 + gdb/xtensa-tdep.c | 70 +- gdb/xtensa-tdep.h | 2 +- include/elf/xtensa.h | 22 + include/xtensa-isa.h | 8 + ld/emultempl/xtensaelf.em | 169 +- 24 files changed, 76128 insertions(+), 188 deletions(-) rename bfd/{xtensa-modules.c => xtensa-default-modules.c} (99%) create mode 100644 bfd/xtensa-esp32-modules.c create mode 100644 bfd/xtensa-esp32s2-modules.c create mode 100644 bfd/xtensa-esp32s3-modules.c rename gdb/{xtensa-config.c => xtensa-config-default.c} (84%) create mode 100644 gdb/xtensa-config-esp32.c create mode 100644 gdb/xtensa-config-esp32s2.c create mode 100644 gdb/xtensa-config-esp32s3.c --- 2.34.1