From mboxrd@z Thu Jan 1 00:00:00 1970 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 8E0E9C38A2D for ; Mon, 24 Oct 2022 11:55:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2B9CD84893; Mon, 24 Oct 2022 13:54:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="sT92RIux"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22D73806FE; Mon, 24 Oct 2022 13:54:30 +0200 (CEST) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 173DB81E0D for ; Mon, 24 Oct 2022 13:54:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x533.google.com with SMTP id a67so30186852edf.12 for ; Mon, 24 Oct 2022 04:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Hrpj6507BX1W+IwdbZ6hyqJWQaYBOmrK+1tW38Ld6H8=; b=sT92RIux5m4QgpZuYisBIZOvPEJMCaF/lzPo6uvvgLpFsZ9vaUb0YxCfnWOyJxyssS QXgd/Hf8AT5nUqAv6ZXxw3lHDoi//4fdYcpSPHGKqDnFu+1+jSvvgK+2VZlczW6ISkOL TgksPYkwgs+F0SiuuDX9PWfPYMOSgeafA4QOJQzg//2a5yZJK+zo0ebO9DHmjNZVy2v9 WufSnYIZ77aMviN2XaQDWHJOnHviVOYmD5s7oarto3mGNPjG/lz6A/sf6zkmK+FiED+L eTRIZd9ZCoY/IzL5rS6PEtY0TWiYa/obD0FNiFK70BrG4P5y0QxsSaGWjUR1IVRqwrsK p5tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Hrpj6507BX1W+IwdbZ6hyqJWQaYBOmrK+1tW38Ld6H8=; b=BQmiqyrp8B1Smty+aHMfi04wozMXGRrvXbikybssoj9UaZJRx+fKR6uQZMuKMWV91G KbP8UHxllEI5GumBRHQgmMskNCAAG2nsuiKl2K/6b0dgW12u1tyxwpM1lupN/Om9KdG0 yYHlZqsPzslGW9qoyeCVYZaLdwPzsVKuFjXbSEJJVctTk1S418kIa/AjGtRKwsd952+9 mpfuvCrQH5H6CiehqUY1x+AcOTUKKxyq2bZIPhS0JzeoxW8yXg2HJ4MRnX3avuh1iUYV RT9e9mrKiTrEYW9JZ9ClAUhhFe59uKgqqCGZ5kEksJHzFuAhU//jpvQhGgfiWZ70bMeq bTZg== X-Gm-Message-State: ACrzQf0jTvTjhy9ruCFsXfhqJwigkAfDuIzbUnJ1SRZLkmbYs17gH5Yf wZPya+IXQt1sbLfJyYc+UR3yTVtnr8s8gA== X-Google-Smtp-Source: AMsMyM6JbizYot1ox0Z0P1pd3zKtWBBJ5aN8g9dkVC8yPvPSZ9HaWXvhZh5QYpet4bI1HyfL96F3jg== X-Received: by 2002:a17:906:9c83:b0:779:c14c:55e4 with SMTP id fj3-20020a1709069c8300b00779c14c55e4mr26482179ejc.619.1666612464578; Mon, 24 Oct 2022 04:54:24 -0700 (PDT) Received: from hera (ppp046103015185.access.hol.gr. [46.103.15.185]) by smtp.gmail.com with ESMTPSA id 24-20020a170906301800b0073dd8e5a39fsm15288806ejz.156.2022.10.24.04.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 04:54:24 -0700 (PDT) Date: Mon, 24 Oct 2022 14:54:21 +0300 From: Ilias Apalodimas To: Paul Barker Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Tom Rini Subject: Re: [PATCH v4 3/6] efi_loader: Add SPI I/O protocol support Message-ID: References: <20221005121839.3938771-1-paul.barker@sancloud.com> <20221005121839.3938771-4-paul.barker@sancloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221005121839.3938771-4-paul.barker@sancloud.com> 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Paul, I think the series overall is in a good state, but we are trying to figure out if we can avoid defining SPI uuid's in the DT. OTOH U-Boot uses the DT for it's config so that might be okay... [...] > +{ > + struct efi_spi_peripheral *peripheral = bus->peripheral_list; > + > + while (peripheral) { > + struct efi_spi_peripheral *next = > + peripheral->next_spi_peripheral; > + destroy_efi_spi_peripheral(peripheral); > + peripheral = next; > + } > + free(bus->friendly_name); > + free(bus); > +} > + > +static efi_status_t efi_spi_new_handle(const efi_guid_t *guid, void *proto) > +{ > + efi_status_t status; > + efi_handle_t handle; > + > + status = efi_create_handle(&handle); > + if (status != EFI_SUCCESS) { > + printf("Failed to create EFI handle\n"); > + goto fail_1; > + } > + > + status = efi_add_protocol(handle, guid, proto); Apologies for this it's my fault, but can you replace efi_add_protocol -> efi_install_multiple_protocol_interfaces? commit 05c4c9e21ae6 ("efi_loader: define internal implementations of install/uninstallmultiple") has some details on why. A bit annoying but the change is straightforward > + if (status != EFI_SUCCESS) { > + printf("Failed to add protocol\n"); > + goto fail_2; > + } > + > + return EFI_SUCCESS; > + > +fail_2: > + efi_delete_handle(handle); Same here, just uninstall the protocol > +fail_1: > + return status; > +} > + > +static void > +efi_spi_init_part(struct efi_spi_part *part, > + struct spi_slave *target, > + efi_string_t vendor_utf16, > + efi_string_t part_number_utf16 > +) > +{ > + part->vendor = vendor_utf16; > + part->part_number = part_number_utf16; > + part->min_clock_hz = 0; > + part->max_clock_hz = target->max_hz; > + part->chip_select_polarity = > + (target->mode & SPI_CS_HIGH) ? true : false; > +} > + Thanks! /Ilias