Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D843C77B61 for ; Tue, 25 Apr 2023 16:55:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 616038625D; Tue, 25 Apr 2023 18:55:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lB0KK0Ss"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 580EC8627B; Tue, 25 Apr 2023 18:55:06 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 70C5C86254 for ; Tue, 25 Apr 2023 18:55:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-763c3429aa6so210610039f.2 for ; Tue, 25 Apr 2023 09:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1682441702; x=1685033702; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aV337ZxEi0j1ok71RIL3hsZFO6NLogjnAmcgz3keK/Q=; b=lB0KK0Ssmhwmqrvj7eD0hNfZA91fx/otBZmijLRlqgkcleFIkm3uCS1NpAJizyWtV8 T5PyLihpy6Xqtz8W0CVrq+hx0UWwZtWLUeKbjoioV4wXUPhI3wqX670b6B0DN1C2T7vp T/RiZesaI9SsTigPCyuXO4FjyDKIzflfGe8DE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682441702; x=1685033702; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aV337ZxEi0j1ok71RIL3hsZFO6NLogjnAmcgz3keK/Q=; b=ihIQ98Ad8Nh9tUv696y+rP43Vvm5gqrRaKT0VP0ivhqMEkfCHge828+AwG7Y2vID/h 4+q1p3l36JL0/+lQNU44y+iielNmgny8E/Fkm4KtDYPT/G9A5Nub1PCxoZrsnbUo4GM3 83k/CLdpWkueRRleXyZKaG4eVkotN6kM0Xen/5izTSFj1PxnwuxRsnftFaUky7dCYf0/ i496+HNhC4Ds71KUeZpbFGVu4QVgd1zzDpls63fZXW1JU1fw3FTbNCEgmn+zYgdXAlVn Ynr5QJXqQ5qsyfqUEk78eDd1jkm0Slor6dOMwhSBI3cLq6jTLjrSQltPltqxuO7hkXMs YjIQ== X-Gm-Message-State: AAQBX9cYR9YMSvD+C1qvvuhkrFuGXXQlFX1r4c/1X9/6P4TzPYQkasZP 90i0twE/6v9pBTTCywhjfhEk+sHUM/ZA9ptAs8E= X-Google-Smtp-Source: AKy350atouZ8pYv5RyyaUnBkQD/sfnukjmNC6eovaW7CJerS5u1mPyahZAbNFOssY68e7EZkeGxFgg== X-Received: by 2002:a5d:9c91:0:b0:760:b5ad:ae18 with SMTP id p17-20020a5d9c91000000b00760b5adae18mr8298421iop.0.1682441702012; Tue, 25 Apr 2023 09:55:02 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:7f65:eb12:5511:27fc]) by smtp.gmail.com with ESMTPSA id j3-20020a5d9d03000000b00762f8d3156asm3871030ioj.14.2023.04.25.09.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 09:55:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 00/30] ide: Clean up code and fix a few bugs Date: Tue, 25 Apr 2023 10:54:25 -0600 Message-ID: <20230425165455.2571932-1-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean This code was converted to driver model a long time again but it was a pretty rough conversion. It introduced a few minor bugs, e.g. the device capacity is incorrect and some flags are lost (such as lba48). This series tidies up the code and fixes these bugs. This involves quite a bit of refactoring, so it is done one patch at a time for easier review. Changes in v2: - Drop [] in patch subject - Rebase to master Simon Glass (30): ide: Move ATA_CURR_BASE to C file ide: Use mdelay() for long delays ide: Drop CONFIG_START_IDE ide: Drop init for not using BLK ide: Move ide_init() into probing ide: Drop ide_device_present() ide: Move a few functions further up the file ide: Drop weak functions ide: Create a prototype for ide_set_reset() ide: Correct use of ATAPI ide: Make function static ide: Change the retries variable ide: Refactor confusing loop code ide: Simplify success condition ide: Avoid preprocessor for CONFIG_ATAPI ide: Avoid preprocessor for CONFIG_LBA48 ide: Move bus init into a function ide: Make ide_bus_ok a local variable ide: Move setting of vendor strings into ide_probe() ide: Move ide_init() entirely within ide_probe() ide: Combine the two loops in ide_probe() ide: Use desc consistently for struct blk_desc ide: Make ide_ident() return an error code ide: Move all blk_desc init into ide_ident() ide: Use a single local blk_desc for ide_ident() ide: Correct LBA setting ide: Tidy up ide_reset() ide: Convert to use log_debug() ide: Simplify expressions and hex values ide: Make use of U-Boot types cmd/ide.c | 22 +- common/board_r.c | 17 - drivers/block/ide.c | 841 ++++++++++++++++++++------------------------ include/blk.h | 5 +- include/ide.h | 48 +-- test/boot/bootdev.c | 2 - 6 files changed, 415 insertions(+), 520 deletions(-) -- 2.40.0.634.g4ca3ef3211-goog